Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I cannot detect my own For Next Error in this code..
Sub SaveTotals() ' ' Detect Phase Total Row from Column I & Save row to Totals Sheet Dim RowNdx As Long, LastRow As Long LastRow = ActiveSheet.UsedRange.Rows.Count For RowNdx = LastRow To 13 Step -1 If Cells(RowNdx, "I").Value = "Phase Totals" Then Cells(RowNdx, "A").Value = Cells(RowNdx, "E7").Value With Sheets("Totals") lr = .Cells(Rows.Count, "a").End(xlUp).Row + 1 Rows(c.Row).Copy .Cells(lr, 1) End With Next RowNdx End Sub Help appreciated, Celeste |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Celeste
Looks like you are missing an End If after your End With. Good luck. Ken Norfolk, Va On Sep 4, 3:52 pm, u473 wrote: I cannot detect my own For Next Error in this code.. Sub SaveTotals() ' ' Detect Phase Total Row from Column I & Save row to Totals Sheet Dim RowNdx As Long, LastRow As Long LastRow = ActiveSheet.UsedRange.Rows.Count For RowNdx = LastRow To 13 Step -1 If Cells(RowNdx, "I").Value = "Phase Totals" Then Cells(RowNdx, "A").Value = Cells(RowNdx, "E7").Value With Sheets("Totals") lr = .Cells(Rows.Count, "a").End(xlUp).Row + 1 Rows(c.Row).Copy .Cells(lr, 1) End With Next RowNdx End Sub Help appreciated, Celeste |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The problem is that you're missing an
End If between End With and Next RowNdx In article . com, u473 wrote: I cannot detect my own For Next Error in this code.. Sub SaveTotals() ' ' Detect Phase Total Row from Column I & Save row to Totals Sheet Dim RowNdx As Long, LastRow As Long LastRow = ActiveSheet.UsedRange.Rows.Count For RowNdx = LastRow To 13 Step -1 If Cells(RowNdx, "I").Value = "Phase Totals" Then Cells(RowNdx, "A").Value = Cells(RowNdx, "E7").Value With Sheets("Totals") lr = .Cells(Rows.Count, "a").End(xlUp).Row + 1 Rows(c.Row).Copy .Cells(lr, 1) End With Next RowNdx End Sub Help appreciated, Celeste |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Saving just 1 worksheet out of a workbook to a separate file | Excel Discussion (Misc queries) | |||
Summing totals on separate worksheet based on 2 criteria | Excel Discussion (Misc queries) | |||
Copying Numerical Totals of separate worksheets to a single Summary Worksheet | Setting up and Configuration of Excel | |||
Copying Numerical Totals of separate worksheets to a single Summary Worksheet | Excel Discussion (Misc queries) | |||
Copying Totals of separate worksheets to a single Summary Worksheet | Excel Discussion (Misc queries) |