Get active cell?

  • Thread starter Thread starter Mat
  • Start date Start date
M

Mat

Hello,
I'm building a simple search function in my workbook. I
have no problem in locating specified text, but I do not
know how to 'get' the location of the current cell, I
tried:

CellMatch = ActiveCell

But, alas, this simply assigns the value of the currently
selected cell to CellMatch. I want the location, "A2" for
example.
Thanks in advance
Mat.
 
Hi Mat
try
sub foo()
dim rng as range
set rng = Activecell
'to get the value use
msgbox rng.value
end sub
 
Mat

Sub gronk()
Set currcel = Application.ActiveCell
MsgBox currcel.Address
End Sub

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top