Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Saving Totals Row to Separate Worksheet - Next w/o For Error ?

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   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Saving Totals Row to Separate Worksheet - Next w/o For Error ?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Saving Totals Row to Separate Worksheet - Next w/o For Error ?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving just 1 worksheet out of a workbook to a separate file Rich D Excel Discussion (Misc queries) 1 January 23rd 08 02:31 AM
Summing totals on separate worksheet based on 2 criteria Cheese_whiz Excel Discussion (Misc queries) 4 January 6th 08 10:34 PM
Copying Numerical Totals of separate worksheets to a single Summary Worksheet buster1831 Setting up and Configuration of Excel 1 February 22nd 05 08:07 AM
Copying Numerical Totals of separate worksheets to a single Summary Worksheet buster1831 Excel Discussion (Misc queries) 2 February 16th 05 11:28 PM
Copying Totals of separate worksheets to a single Summary Worksheet buster1831 Excel Discussion (Misc queries) 0 February 16th 05 10:25 PM


All times are GMT +1. The time now is 12:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"