ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get active cell? (https://www.excelbanter.com/excel-programming/292142-get-active-cell.html)

Mat

Get active cell?
 
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.

Frank Kabel

Get active cell?
 
Hi Mat
try
sub foo()
dim rng as range
set rng = Activecell
'to get the value use
msgbox rng.value
end sub

--
Regards
Frank Kabel
Frankfurt, Germany

Mat wrote:
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.


Gord Dibben

Get active cell?
 
Mat

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

Gord Dibben Excel MVP

On Sat, 21 Feb 2004 10:45:33 -0800, "Mat" wrote:

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.



Matthew John Antoszkiw

Get active cell?
 
Thanks, got it working now :)

"Mat" wrote in message
...
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.





All times are GMT +1. The time now is 10:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com