Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default VB macro script to find column A in Excel when row not known

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default VB macro script to find column A in Excel when row not known

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default VB macro script to find column A in Excel when row not known

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default VB macro script to find column A in Excel when row not known

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
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
Excel Macro or other script MartinaL Excel Programming 7 July 7th 05 01:19 AM
Excel Macro using vb script Lillian Excel Programming 2 January 7th 05 05:13 AM
Need Macro to Find Column Heading -- if none, then insert new column Jeff[_43_] Excel Programming 0 December 15th 04 07:08 AM


All times are GMT +1. The time now is 09:52 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"