Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In writing a VB macro for an Excel workbook, I want the user to be able to
insert a row in the active sheet by clicking a (command) button, and then have the macro continue to do some copying, etc. Because the active cell's row is unknown, how do I get the macro to make column 1 of the active row (cell A?) the active cell?. Certain other macro actions will be dependant on this. All help appreciated! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
yoe mean sth. like this?
Cells(ActiveCell.Row, 1).Activate On 12 Lis, 11:19, Pete wrote: In writing a VB macro for an Excel workbook, I want the user to be able to insert a row in the active sheet by clicking a (command) button, and then have the macro continue to do some copying, etc. Because the active cell's row is unknown, how do I get the macro to make column 1 of the active row (cell A?) the active cell?. Certain other macro actions will be dependant on this. All help appreciated! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You dont need to activate or select a cell to write data in.
You can refer the cell as Range("A" & activecell.Row) = "something" OR Cells(ActiveCell.Row,1) = "something" To insert a row at the active cell Rows(activecell.Row).insert To activate... Range("A" & activecell.Row).Activate If this post helps click Yes --------------- Jacob Skaria "Pete" wrote: In writing a VB macro for an Excel workbook, I want the user to be able to insert a row in the active sheet by clicking a (command) button, and then have the macro continue to do some copying, etc. Because the active cell's row is unknown, how do I get the macro to make column 1 of the active row (cell A?) the active cell?. Certain other macro actions will be dependant on this. All help appreciated! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Pete,
I am not sure if I am interpreting your question correctly. Do you mean that if a cell is selected anywhere on the worksheet, you want to select the cell in column A with the same row number? If so, the the following code should do what you want. Cells(ActiveCell.Row, "A").Select -- Regards, OssieMac |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Macro or other script | Excel Programming | |||
Excel Macro using vb script | Excel Programming | |||
Need Macro to Find Column Heading -- if none, then insert new column | Excel Programming |