Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am working on some code that will look at each row (starting at ro 2) and define the row by the value that is on the row in column 1 until the program gets to a cell that is blank, in which the loo stops. Everything seems to be working except for one small part. keep on getting Run-time error 1004: That Name is not valid. The following is my code: Private Sub cmdCatAddSyn_Click() 'Synchronize all pages with the new category 'IN PROGRESS RCount = 2 Do Until Worksheets(1).Cells(RCount, 1).Value = "" Worksheets(1).Rows(RCount).Name = Worksheets(1).Cells(RCount, 1) RCount = RCount + 1 Loop End Sub The section of code that is always highlighted i Worksheets(1).Rows(RCount).Name=Worksheets(1).Cell s(RCount,1) All help is appreciated, and thank you in advance -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
names can't have spaces and must being with a letter. The name also can't
be ambiguous in terms of being a cell reference (you can't create a name like A10 for example, or R1 or C5). If it is mostly working, I suspect the value in the cell is not a legal name. -- Regards, Tom Ogilvy "fifthhorseman " wrote in message ... Hi, I am working on some code that will look at each row (starting at row 2) and define the row by the value that is on the row in column 1, until the program gets to a cell that is blank, in which the loop stops. Everything seems to be working except for one small part. I keep on getting Run-time error 1004: That Name is not valid. The following is my code: Private Sub cmdCatAddSyn_Click() 'Synchronize all pages with the new category 'IN PROGRESS RCount = 2 Do Until Worksheets(1).Cells(RCount, 1).Value = "" Worksheets(1).Rows(RCount).Name = Worksheets(1).Cells(RCount, 1) RCount = RCount + 1 Loop End Sub The section of code that is always highlighted is Worksheets(1).Rows(RCount).Name=Worksheets(1).Cell s(RCount,1) All help is appreciated, and thank you in advance. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
loop through all named ranges | Excel Programming | |||
Loop through ranges | Excel Programming | |||
Loop through ranges columns | Excel Programming | |||
How to loop through all ranges in a worksheet | Excel Programming | |||
loop to name ranges | Excel Programming |