Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm brand new to macros, so I apologize if this is a particularly dumb
question. I'm copying a hidden row and trying to insert it just below a button on a spreadsheet. The location of the button will be variable, so I need the row to be inserted relative to the position of the button. Here's what I have so far: Sub Button64_Click() ' ' ActiveSheet.Unprotect Password:="test" Rows("9").EntireRow.Hidden = False Rows("9:9").Select Selection.Copy Rows("22:22").Select Selection.Insert Shift:=xlDown Rows("9").EntireRow.Hidden = True ActiveSheet.Protect Password:="test" End Sub Instead of 'Rows("22:22").Select', I need to select the row immediately after the button. I'm sure there's a much more elegant way to do this, so any suggestions are very welcome! Thanks so much! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to macro to relative position | Excel Discussion (Misc queries) | |||
Relative position of Employees | Excel Worksheet Functions | |||
Relative Position in VBA Array | Excel Programming | |||
Macro relative to button position | Excel Programming | |||
relative position in macro | Excel Programming |