Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
GoBobbyGo
 
Posts: n/a
Default Cell references in VBA?

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Cell references in VBA?

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)

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



  #3   Report Post  
Posted to microsoft.public.excel.misc
MartinShort
 
Posts: n/a
Default Cell references in VBA?


Any easy way to get the X and Y coords of the cell?


--
MartinShort

Software Tester
------------------------------------------------------------------------
MartinShort's Profile: http://www.excelforum.com/member.php...o&userid=22034
View this thread: http://www.excelforum.com/showthread...hreadid=494191

  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Cell references in VBA?

You can get it relative to the spreadsheet with Activecell.Left and .Top.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"MartinShort"
wrote in message
...

Any easy way to get the X and Y coords of the cell?


--
MartinShort

Software Tester
------------------------------------------------------------------------
MartinShort's Profile:

http://www.excelforum.com/member.php...o&userid=22034
View this thread: http://www.excelforum.com/showthread...hreadid=494191



  #5   Report Post  
Posted to microsoft.public.excel.misc
MartinShort
 
Posts: n/a
Default Cell references in VBA?


Cheers Bob


--
MartinShort

Software Tester
------------------------------------------------------------------------
MartinShort's Profile: http://www.excelforum.com/member.php...o&userid=22034
View this thread: http://www.excelforum.com/showthread...hreadid=494191

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel insits that I use absolute cell references Espen Excel Discussion (Misc queries) 6 January 5th 17 05:47 AM
Fixed cell references rhythm_man Excel Discussion (Misc queries) 2 July 5th 05 01:14 PM
How to use complex no. functions that have cell references? agathon Excel Worksheet Functions 2 June 17th 05 01:55 AM
Cell references change when entering new data [email protected] New Users to Excel 2 May 6th 05 07:48 PM
Absolute cell references and subsequent problems. Pank Mehta Excel Discussion (Misc queries) 2 April 19th 05 11:38 AM


All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"