Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Retrieving a Name of Cell

I wish to replace the cell references in a series of formulas with the
cells name.

For Each rngcell In rngRange
strFormula = rngcell.Formula
'and if the the formula begins with a '=' and DOES NOT contain a
'.'
If Left(strFormula, 1) = "=" And InStr(1, strFormula, ".") = 0
Then
'Then we need to iteratively replace each cell reference with a
name reference...

If InStr(strFormula, "+") = 0 Then ' then it is just in the
form '=A34'
Set rngcell2 =
shtCurrent.Range(Right(strFormula, Len(strFormula) - 1))
msgbox rngcell2.Name ' I would hope this returned the
cells name (e.g. TotalSales)

'here i will manipulate the string and replace the cell reference with
a named ref.
End if

Next

The problem is that the rngCell2.Name returns the cells other name
(e.g. SheetName!$A$34)

How do I get the given name?

Many thanks for any help
steve

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Retrieving a Name of Cell

Found it....

very very very simple!!!

rngCell2.Name.Name

Hope this helps someone else!

Steve

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
Retrieving a tuple for a cell. SRK Excel Discussion (Misc queries) 0 November 6th 06 09:51 AM
Cell searching and retrieving fluci Excel Discussion (Misc queries) 5 August 4th 05 03:37 PM
Retrieving a value from a cell Paul Lee Excel Programming 2 August 19th 04 06:48 PM
Help Retrieving Cell Values Marshall Excel Programming 1 October 28th 03 05:32 PM
Retrieving a cell value with a SQL statement Douglas José Soares Rodrigues Excel Programming 0 August 12th 03 03:21 PM


All times are GMT +1. The time now is 12:50 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"