View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ronny Hamida[_2_] Ronny Hamida[_2_] is offline
external usenet poster
 
Posts: 4
Default Range Naming using cell data

And one final question!

I'm not sure if I have to initialize any variables in my
macro for this one. I'd like to define a cell name using
the first four characters from another cell.

Here's what I had tried, but obviously I'd get an invalid
name:

ActiveWorkbook.Names.Add Name:=Left(Cells
(row_index, "D").Value, 4), RefersToR1C1:=Cells(row_index
+ 1, "C")

Here's a sample cut of the data:

Column C Column D
1 xxxx99999
1 xxxx99999
TOTAL: 2 (blank)

I want to define the cell with TOTAL as "xxxx"

Thank you all again for the assistance!
Ronny