Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Selection in VBA
What is the proper method for doing a selection that is the equivalent of
manually using the ctrl, shift and down arrow keys to select from the starting point to the end of the data? I have a macro that works and tried to modify that code to work, but have not been successful. The pointer moves to cell K2 but the selection doesn't work. After it is selected I'm planning to change the format of the column of data. Thanks, xls is an object that is the worksheet selected from the excel object. xls.Range("K2").Select xls.Range(Selection, Selection.End(xlDown)).Select xls.Selection.NumberFormat = "0" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Selection in VBA
Jeep,
you are better off avoiding selection statements completely. This will format the range you want directly. with xls .range(.range("k2"),.range("k2").End(xlDown)).numb erformat = "0" end with Robin Hammond www.enhanceddatasystems.com "JeepNC" wrote in message ... What is the proper method for doing a selection that is the equivalent of manually using the ctrl, shift and down arrow keys to select from the starting point to the end of the data? I have a macro that works and tried to modify that code to work, but have not been successful. The pointer moves to cell K2 but the selection doesn't work. After it is selected I'm planning to change the format of the column of data. Thanks, xls is an object that is the worksheet selected from the excel object. xls.Range("K2").Select xls.Range(Selection, Selection.End(xlDown)).Select xls.Selection.NumberFormat = "0" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
Identifying a selection of a selection of a range | Excel Worksheet Functions | |||
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. | Excel Programming | |||
Excel VBA : Sheet selection | Excel Programming |