LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting a row relative to the position of a button

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to macro to relative position jk9533 Excel Discussion (Misc queries) 6 October 15th 07 08:11 PM
Relative position of Employees Bob Davison Excel Worksheet Functions 9 May 8th 07 07:23 PM
Relative Position in VBA Array jgdavis Excel Programming 0 June 23rd 04 03:09 PM
Macro relative to button position wesandem Excel Programming 14 January 26th 04 03:08 AM
relative position in macro pabs[_10_] Excel Programming 4 January 3rd 04 06:25 AM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"