activecell - transfer value

  • Thread starter Thread starter johnT
  • Start date Start date
J

johnT

i would like to use the macro activecell function to
facilitate cell input. is there a way simply by selecting
a cell and having the value of that cell transfered to
another cell?
 
Range("A3").value = Activecell.Value

puts the activecell value in A3

or

Activecell..offset(0,3).Value= Activecell.Value

puts the active value in the cell 3 columns to the right

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
One way:

Put this in your worksheet code module (right-click on the worksheet tab
and choose view code):


Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Application.EnableEvents = False
Range("A1").Value = ActiveCell.Value
Application.EnableEvents = True
End Sub

Change "A1" to the cell reference of your "another cell".
 
One way:

Put this in your worksheet code module:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Const sPARTICULAR_CELL_ADDR As String = "J10"
Const sDESTINATION_ADDR As String = "A1"

If ActiveCell.Address(False, False) = sPARTICULAR_CELL_ADDR Then
Application.EnableEvents = False
Range(sDESTINATION_ADDR).Value = ActiveCell.Value
Application.EnableEvents = True
End If
End Sub

Change the value of sPARTICULAR_CELL_ADDR to the address of your
"particular cell"

Change sDESTINATION_ADDR to the address of your destination cell.
 
I'm not sure what you're asking. What would make that different than
what I posted?
 
Back
Top