PC Review


Reply
Thread Tools Rate Thread

Determining row # of selected cell

 
 
=?Utf-8?B?Qm9i?=
Guest
Posts: n/a
 
      25th Sep 2007
I need to determine and then store the row number of the cell that has been
selected in the active workbook. Later, after running some additional code,
I need to select the cell in column A using the row number that was stored in
the first step.

Can someone kindly show me how to do this? Thanks in advance for the help.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      25th Sep 2007
Bob,

Try this

Sub getrow()
myAddress = ActiveCell.Row

'write row number to A1 (Change to suit)
Sheets("Sheet1").Cells(1, 1).Value = myAddress
'run some other code

'Get row number from A1 on sheet 1
Cells(Sheets("Sheet1").Cells(1, 1).Value, 1).Select
End Sub

Mike

"Bob" wrote:

> I need to determine and then store the row number of the cell that has been
> selected in the active workbook. Later, after running some additional code,
> I need to select the cell in column A using the row number that was stored in
> the first step.
>
> Can someone kindly show me how to do this? Thanks in advance for the help.

 
Reply With Quote
 
=?Utf-8?B?Qm9i?=
Guest
Posts: n/a
 
      25th Sep 2007
Mike - Thanks!


"Mike H" wrote:

> Bob,
>
> Try this
>
> Sub getrow()
> myAddress = ActiveCell.Row
>
> 'write row number to A1 (Change to suit)
> Sheets("Sheet1").Cells(1, 1).Value = myAddress
> 'run some other code
>
> 'Get row number from A1 on sheet 1
> Cells(Sheets("Sheet1").Cells(1, 1).Value, 1).Select
> End Sub
>
> Mike
>
> "Bob" wrote:
>
> > I need to determine and then store the row number of the cell that has been
> > selected in the active workbook. Later, after running some additional code,
> > I need to select the cell in column A using the row number that was stored in
> > the first step.
> >
> > Can someone kindly show me how to do this? Thanks in advance for the help.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining Range of selected cell mark.diffley@gmail.com Microsoft Excel Programming 2 5th Dec 2006 06:49 AM
Changing cell colour when cell selected/de-selected by mouse/arrow keys Joe Hannett Microsoft Excel Misc 5 12th Aug 2004 05:39 PM
Determining how a combo box got selected Juan Galvez Microsoft Access Form Coding 4 5th Mar 2004 02:18 PM
Determining selected worksheet Bob Conar Microsoft Excel Programming 3 20th Oct 2003 01:51 AM
Determining whether selected cell has value or formula? John Wirt Microsoft Excel Programming 3 31st Jul 2003 04:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:57 AM.