Please help..... VBA Code amendment

bsnapool

Active Member
Joined
Jul 10, 2006
Messages
452
Hi All

I am considering of arranging my code so the output is different. The code I have at the minute (Below) is extracting data from multiple spreadsheet copying to summary sheet.

Code is:

Code:
Then 'If there is entry in col F to L  or N to S copy the row to Summary
     
               lRowTo = lRowTo + 1 'last used row in the summary +1
                                        With wsSumm ' the copy
                                            .Rows(lRowTo).Value = WS.Rows(R).Value
                                            .Cells(lRowTo, "A").Value = "Week " & sWeeks(iWeekPtr)
                                            
                                        End With
                                     Else   
                                   End If
                              Else
                               
                            End If
                        Next R
                         LogEntry ExcelFile:=Filenm, _
                                 Week:="Week " & sWeeks(iWeekPtr), _
                                 Message:="PROCESSED"
                    End If
                Else
                    lRowTo = lRowTo + 1
                    With wsSumm
                        .Cells(lRowTo, "A").Value = "Week " & sWeeks(iWeekPtr)
                        .Cells(lRowTo, "B").Value = "NOT FOUND"
                    End With
                   LogEntry ExcelFile:=Filenm, _
                            Week:="Week " & sWeeks(iWeekPtr), _
                            Message:="NOT FOUND"
                End If
            Next iWeekPtr
        
                           .DisplayAlerts = False
                ActiveWorkbook.Close
                .DisplayAlerts = True
            End With
        End If
    End If
Next I
    
 
With Application
    .StatusBar = False
    .EnableEvents = True
    .ScreenUpdating = True
End With
End Sub

The current layout is:

Team Name
Row which has been copied

Total:

Team Name
week number, Row which has been copied

Total:

I was wondering what I would have to do to edit the code so it would look like this:

Team Name,week number, Row which has been copied

This would be really really helpful, and I would really appreciate anybody help...

Thanks in advance.

Andrew
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,216,219
Messages
6,129,575
Members
449,519
Latest member
Rory Calhoun

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top