Hello,
I'm trying to pass the Range Name of the active cell every time the Worksheet_SelectionChange event is called.
This code doesn't work...
Can anyone advise why ActiveCell.Name returns the string "='Sheet1!$A$1" if cell A1 has a name eg "firstCell", but returns an error if cell A1 does not have a name; in debug mode the 'tool tip' shows "ActiveCell.name = <Application-defined or Object-defined error>.
In this example, I want to pass the string "firstCell" - Any ideas?
Thank you,
M.
I'm trying to pass the Range Name of the active cell every time the Worksheet_SelectionChange event is called.
This code doesn't work...
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim rangeString As String
rangeString = ActiveCell.name
Call Worksheet_highlight(rangeString)
End Sub
Can anyone advise why ActiveCell.Name returns the string "='Sheet1!$A$1" if cell A1 has a name eg "firstCell", but returns an error if cell A1 does not have a name; in debug mode the 'tool tip' shows "ActiveCell.name = <Application-defined or Object-defined error>.
In this example, I want to pass the string "firstCell" - Any ideas?
Thank you,
M.