Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Cells(row_index + 1, "C").Name = Left(Cells(row_index, "D").Value) -- Regards, Tom Ogilvy "Ronny Hamida" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure if you have a problem, but it is easier to use
ActiveWorkbook.Activesheet.Cells(row_index + 1, "C").Name=Left(Cells (row_index, "D").Value, 4) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Ronny Hamida" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you both! Works perfectly!
Cheers, Ronny |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Naming a Data Range | Excel Discussion (Misc queries) | |||
Naming the range of data | Excel Discussion (Misc queries) | |||
Data Tables and Cell Naming | Excel Discussion (Misc queries) | |||
Naming cell ranges, copying formulas for a range & nesting "IF" fu | Excel Discussion (Misc queries) | |||
VB Code Naming a Range (range changes each time) | Excel Programming |