Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a range using VBA
How can I goto A2 then emulate the keystrokes [Control]
[Shift][End] then [Shift][Home] tocapture column A for the height of the data using VBA? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a range using VBA
try
Sub selectit() x = ActiveSheet.UsedRange.Rows.Count Range(Cells(2, 1), Cells(x, 1)).Select End Sub -- Don Guillett SalesAid Software " wrote in message ... How can I goto A2 then emulate the keystrokes [Control] [Shift][End] then [Shift][Home] tocapture column A for the height of the data using VBA? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a range using VBA
I suggest this code if the data is continuous (no empty
cells) Dim rng As Range Set rng = Range(Range("A2"),Range("A2").End(xlDown)) or if not continuous Dim rng As Range Set rng = Range(Range("A2"),Range("A65536").End(xlUp)) Kevin Beckham -----Original Message----- try Sub selectit() x = ActiveSheet.UsedRange.Rows.Count Range(Cells(2, 1), Cells(x, 1)).Select End Sub -- Don Guillett SalesAid Software " wrote in message ... How can I goto A2 then emulate the keystrokes [Control] [Shift][End] then [Shift][Home] tocapture column A for the height of the data using VBA? Thanks . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a range using VBA
Kevin,
Perhaps a re-reading of OP's request would be helpful for you. -- Don Guillett SalesAid Software "Kevin Beckham" wrote in message ... I suggest this code if the data is continuous (no empty cells) Dim rng As Range Set rng = Range(Range("A2"),Range("A2").End(xlDown)) or if not continuous Dim rng As Range Set rng = Range(Range("A2"),Range("A65536").End(xlUp)) Kevin Beckham -----Original Message----- try Sub selectit() x = ActiveSheet.UsedRange.Rows.Count Range(Cells(2, 1), Cells(x, 1)).Select End Sub -- Don Guillett SalesAid Software " wrote in message ... How can I goto A2 then emulate the keystrokes [Control] [Shift][End] then [Shift][Home] tocapture column A for the height of the data using VBA? Thanks . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting a range using VBA
Don,
You're right, it's just that I never consider empty formatted cells to be "useful" . Kevin -----Original Message----- Kevin, Perhaps a re-reading of OP's request would be helpful for you. -- Don Guillett SalesAid Software "Kevin Beckham" wrote in message ... I suggest this code if the data is continuous (no empty cells) Dim rng As Range Set rng = Range(Range("A2"),Range("A2").End(xlDown)) or if not continuous Dim rng As Range Set rng = Range(Range("A2"),Range("A65536").End(xlUp)) Kevin Beckham -----Original Message----- try Sub selectit() x = ActiveSheet.UsedRange.Rows.Count Range(Cells(2, 1), Cells(x, 1)).Select End Sub -- Don Guillett SalesAid Software " wrote in message ... How can I goto A2 then emulate the keystrokes [Control] [Shift][End] then [Shift][Home] tocapture column A for the height of the data using VBA? Thanks . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
VBA setting Range | Excel Discussion (Misc queries) | |||
VBA setting range in another sheet | Excel Discussion (Misc queries) | |||
Setting print range using VBA | Excel Programming | |||
Setting Print range | Excel Programming |