cursor reference

  • Thread starter Thread starter erables40
  • Start date Start date
E

erables40

I want to know if this is possible? If I have text in column A can I
scroll down the text and in let's say in cell B1 it shows the text of
where my cursor is? So if my cursor is on cell A5 B1 shows the text in
A5 if I scroll down and stop on A15 cell B1 shows the text in A15.
Tried searching but couldn't find anything.
TIA
 
Very difficult if you mean a mouse hover (like viewing a comment). Easy if
you mean clicking on a cell or using the arrow keys to navigate up & down.

Put the following event macro in the worksheet code area:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set r = Range("A:A")
If Intersect(r, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("B1").Value = Target.Value
Application.EnableEvents = True
End Sub
 
You could put some VBA code in your worksheet. Press Alt+F11 to activate
VBA. Select the worksheet name in the workbook where you want the code and
double click on it and paste the following code in the code window.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("a:a")) Is Nothing Then Exit Sub
Range("b1") = Target
End Sub

Then press Alt+F11 to return to your worksheet.

If your cursor is in Column A you will see the value of the cell in Column A
appear in B1
 
You could put some VBA code in your worksheet. Press Alt+F11 to activate
VBA. Select the worksheet name in the workbook where you want the code and
double click on it and paste the following code in the code window.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("a:a")) Is Nothing Then Exit Sub
Range("b1") = Target
End Sub

Then press Alt+F11 to return to your worksheet.

If your cursor is in Column A you will see the value of the cell in Column A
appear in B1

beautiful exactly what I needed
Thanks
 
Back
Top