Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
getting a simple macro to begin execution on the selected cell
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? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
getting a simple macro to begin execution on the selected cell
ActiveCell.Select
or don't Select at all. -- Gary's Student gsnu200703 "bolchman" wrote: 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? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
getting a simple macro to begin execution on the selected cell
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 "Gary''s Student" wrote: ActiveCell.Select or don't Select at all. -- Gary's Student gsnu200703 "bolchman" wrote: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Jump to next cell after selecting from drop down list | Excel Worksheet Functions | |||
insert date | Excel Worksheet Functions | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Running a macro in a selected cell... | Excel Discussion (Misc queries) | |||
Perform oiperations relative to initial selected cell | Excel Discussion (Misc queries) |