
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("a2").Offset(0, 1).FormulaR1C1 = "=" & Range("a2").Value
End Sub |
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rA As Long
Dim rB As Long
Dim rTot As Long
Dim i As Long
If Not (Application.Intersect(Target, Range("A:B")) Is Nothing) Then
rA = Range("A" & Rows.Count).End(xlUp).Row
rB = Range("B" & Rows.Count).End(xlUp).Row
rTot = rA
If rB > rA Then rTot = rB
For i = 1 To rTot
If Cells(i, 1) = "" Then
Cells(i, 2) = ""
Else
Cells(i, 2) = "=" & Cells(i, 1)
End If
Next i
End If
End Sub |
