Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I get the following error when I run this code:
----- Error: Run-time error '1004': That name is not valid. ----- Code: Dim lastrow As Long Dim row_index As Long For row_index = lastrow - 1 To 1 Step -1 If Left(Cells(row_index, "D").Value, 4) < Left (Cells(row_index + 1, "D").Value, 4) Then Cells(row_index + 1, "D").Resize(2, 1).EntireRow.Insert (xlShiftDown) Cells(row_index + 1, "C").FormulaR1C1 = "=SUMPRODUCT(--(LEFT(R1C4:R[-1]C4,4)=LEFT(R[-1] C4,4)),R1C3:R[-1]C3)" Cells(row_index + 1, "C").Font.ColorIndex = 3 Cells(row_index + 1, "C").Font.Bold = True Cells(row_index + 1, "C").Font.Size = 14 Cells(row_index + 1, "C").Name = Left(Cells (row_index, "D").Value, 4) End If Next Debugging points to the last line in the for loop (naming the cell using the first four characters from the cell above.) Thanks in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Validation of partial data in a cell. | Excel Discussion (Misc queries) | |||
Formula for Pulling partial data from one cell into another | Excel Worksheet Functions | |||
remove partial data from cell | Excel Worksheet Functions | |||
combining partial data from 2 different cells | Excel Discussion (Misc queries) | |||
Bringing partial data from one cell into another | Excel Worksheet Functions |