How do I find out which cell I've selected?
I have a VBA routine that selects a (one-cell) named range, which will
likely move around due to row/column insertions and deletions.
How can I get VBA to know what actual cell it's in?
Activecell is the active cell of a selection, so if the selection is one
cell, it is also the selection.
You can work with that
Msgbox Activecell.Value
or get properties of it
Msgbox Activecell.Address
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
quot;GoBobbyGoquot; gt; wrote in message
...
gt; How do I find out which cell I've selected?
gt;
gt; I have a VBA routine that selects a (one-cell) named range, which will
gt; likely move around due to row/column insertions and deletions.
gt;
gt; How can I get VBA to know what actual cell it's in?
Any easy way to get the X and Y coords of the cell?--
MartinShort
Software Tester
------------------------------------------------------------------------
MartinShort's Profile: www.excelforum.com/member.php...oamp;userid=22034
View this thread: www.excelforum.com/showthread...hreadid=494191You can get it relative to the spreadsheet with Activecell.Left and .Top.
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
quot;MartinShortquot; gt;
wrote in message
...
gt;
gt; Any easy way to get the X and Y coords of the cell?
gt;
gt;
gt; --
gt; MartinShort
gt;
gt; Software Tester
gt; ------------------------------------------------------------------------
gt; MartinShort's Profile:
www.excelforum.com/member.php...oamp;userid=22034
gt; View this thread: www.excelforum.com/showthread...hreadid=494191
gt;
Cheers Bob--
MartinShort
Software Tester
------------------------------------------------------------------------
MartinShort's Profile: www.excelforum.com/member.php...oamp;userid=22034
View this thread: www.excelforum.com/showthread...hreadid=494191
- Oct 05 Fri 2007 20:40
Cell references in VBA?
close
全站熱搜
留言列表
發表留言