want cell J1 to reflect the location of acitivecell.value

  • Thread starter Thread starter Gordy99
  • Start date Start date
G

Gordy99

would like cell J1 to reflect the row the activecell is in with the value of
column A.
 
I think this worksheet code does what you want...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("J1").Value = Cells(ActiveCell.Row, 1).Value
End Sub

Rick
 
Thanks, I'll try it.

Rick Rothstein (MVP - VB) said:
I think this worksheet code does what you want...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("J1").Value = Cells(ActiveCell.Row, 1).Value
End Sub

Rick
 
This is the code I put in:
Private Sub worksheet_selectionchange(ByVal target As Range)

Range("j1").Value = Cells(ActiveCell.Row, 1).Value
End Sub

Can't find it on the macro list and I don't see it running.
Gordy
 
It is not a macro... it is a worksheet event procedure. Every time a new
cell becomes active, the code will "do its thing", automatically. The
procedure should be placed in the worksheet's code window, NOT in a Module
nor in a UserForm.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top