Identify Cell location in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I'm trying to identify the current cell location using code. For example, the active cell is A1. I was looking for some code which would take the active cell and store it in a variable. Any help would be appreciated.

James
 
James,

Try this:

Sub TestMe()
Dim MyRange As String
MyRange = ActiveCell.Address
MsgBox MyRange
End Sub

John

James Stricklen said:
Hello, I'm trying to identify the current cell location using code. For
example, the active cell is A1. I was looking for some code which would
take the active cell and store it in a variable. Any help would be
appreciated.
 
James,

Sub test()
Dim rng As Range

Set rng = ActiveCell
Debug.Print rng.Address
End Sub

Rob


James Stricklen said:
Hello, I'm trying to identify the current cell location using code. For
example, the active cell is A1. I was looking for some code which would
take the active cell and store it in a variable. Any help would be
appreciated.
 
Back
Top