what is the code for ctrl+A

smiler44

Registered User.
Local time
Today, 20:49
Joined
Jul 15, 2008
Messages
671
I need to use ctrl+A but can not find what the code
equivalent is, or is it sendkeys?

I want to select the rows and columns with data in but not select the whole sheet as this seems to give me a pasting problem.

smiler44
 
Is this from Access or in Excel?

If in Excel you can use

Cells.Select

and if in Access you should use your Excel Object:

xlApp.Cells.Select
 
Bob,
thank you
I seem to be getting a message saying I need to paste or something similar in R1C1 format if I use cells.select.
I am copying from an Excel workbook to another Excel workbook.
If I use ctrl+a and then paste I dont seem to get this problem and also ctrl+A only seems to select the columns and rows with data in, cells.select copies the whole sheet I think. I am going from memory from this morning so may have got meself a bit mixed up.
smiler44
 
Are you not copying and pasting an entire worksheet? If you are only copying a partial worksheet and then wanting to paste in the other worksheet, you should figure out the range and use that.
 
Bob,
thank you. a Google search gave me :-
Worksheets("Sheet1").Activate
ActiveSheet.UsedRange.Select

A couple of tests look ok, I'll try it in my project

smiler44:)
 

Users who are viewing this thread

Back
Top Bottom