![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
I have a macro which copies a column of data (variable length) to a certain part of a spreadsheet. I want to select the range and apply a name to it. When I use the Select Current Region option, it is recorded in the macro with the precise cell references, which is no use when running the macro for a list of a different length. Also, it cannot record the keystrokes of holding the tab down and pressing END.
Can anyone help? Thanks, Andrew |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Try recording the Ctrl-* combination. Alternatively, use the VBA code Activecell.CurrentRegion.Name="Any text"
Marc |
|
|
|
#3 | |
|
Guest
Posts: n/a
|
Quote:
The VBA code worked beautifully. Many thanks. Incidentally, I didn't understand what you meant by "Try recording the Ctrl-* combination" - something about creating an outline? Many thanks again Andrew |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|