Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Get a cell's name in VBA

Hello,
Could anyone point out how to get a cell's name in the VBA code.
I am trying to retrieve a cell's name - for example suppose target is
the range object pointing to a single cell.
Following lines get the cell address instead of cell name.
target.Name or target.Cells(1, 1).Name
How do I get the cell's name instead of address?
Thanks in advance



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Get a cell's name in VBA

Pallavi

You have to use the name property twice:

Target.Name.Name

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Pallavi Singh" skrev i en meddelelse
...
Hello,
Could anyone point out how to get a cell's name in the VBA code.
I am trying to retrieve a cell's name - for example suppose target is
the range object pointing to a single cell.
Following lines get the cell address instead of cell name.
target.Name or target.Cells(1, 1).Name
How do I get the cell's name instead of address?
Thanks in advance





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Get a cell's name in VBA


Leo,
Thanx for your quick response.
The problem is that 'Name' is being exposed as a property. Hence
when I do a 'targetRange.Name.Name' I get a runtime error 'Object
doesn't support this property or method', error 438. Do I need to set
some sort of property to True to make this work?
Thanx


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Get a cell's name in VBA

You're welcome, Pallavi.

Please post the full code + which
version of Excel you are using to the group.

I have to leave at 9.00, so if your
posting is later than that, I won't be
able to answer until this afternoon.
(right now it's 7.30 in the morning in Denmark)

--
Best Regards
Leo Heuser

Followup to newsgroup only please.


"Pallavi Singh" skrev i en meddelelse
...

Leo,
Thanx for your quick response.
The problem is that 'Name' is being exposed as a property. Hence
when I do a 'targetRange.Name.Name' I get a runtime error 'Object
doesn't support this property or method', error 438. Do I need to set
some sort of property to True to make this work?
Thanx


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Get a cell's name in VBA

Hi Leo,

Actually using targetRange.Name.Name did solve the problem.
I don't know why it din't work 1st time. But its working right now.
Thanks for your help :)



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Get a cell's name in VBA

Glad it worked for you, Pallavi :-)
Thanks for the feedback.

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Pallavi Singh" skrev i en meddelelse
...
Hi Leo,

Actually using targetRange.Name.Name did solve the problem.
I don't know why it din't work 1st time. But its working right now.
Thanks for your help :)



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
Using 1 cell's value as a reference Oddjob Excel Discussion (Misc queries) 4 October 28th 09 07:12 PM
row= cell's row wptech Excel Worksheet Functions 3 July 11th 06 09:07 AM
How to change an other cell's value? Nirel Excel Discussion (Misc queries) 1 February 1st 06 11:20 AM
returning a cell's value and a corresponding value Force Flow Excel Worksheet Functions 2 November 24th 05 08:17 PM
How do I get a cell's row number Mattias[_2_] Excel Programming 2 August 19th 03 07:55 AM


All times are GMT +1. The time now is 08:03 AM.

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

About Us

"It's about Microsoft Excel"