getting a simple macro to begin execution on the selected cell

B

bolchman

I created a simple macro to rearrange some cells, but I need it to start
relative to the cell selected. It always goes back to the cell selected when
I created the macro. I looked at the Visual Basic editor and it shows --
Range("A30").Select --, I don't want to start at "A30" every time, I want to
have that be a variable. How can I do that?
 
B

bolchman

Thanks for replying. Here is the macro. I want it to add line spacing, etc.
relative to the cell selected when I run it. Right now it looks hardwired
for the cell "A30" and others. I don't know how to do that.


Sub line_space()
'
' line_space Macro
' Macro recorded 2/2/2007 by ...
'
' Keyboard Shortcut: Ctrl+s
'
Range("A30").Select
Selection.EntireRow.Insert
Selection.RowHeight = 12.75
Range("A32").Select
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Range("A43").Select
Selection.RowHeight = 85
Range("A44").Select
End Sub
 
Top