Summerizing multiple worksheet contents into one worksheet

T

tweakitguy

Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Power PC I have a VBA script that with the click of a button, it grabs all the rows from four worksheets and compiles the list and sorts it in the "summary" work sheet.

Very new to MAC's and AppleScript, and have no clue how to do this effectively. Any help or guidance would be appreciated. Below is the actual VBA script that I am using.

Sub Button2_Click()
    Sheet1.Range("A6", "F" & Sheet1.Range("A6").End(xlDown).Row).ClearContents
    ' Add sheet2 Data
    Dim maxRow
    Dim NextRow
    NextRow = 6
    maxRow = Sheet2.Range("A4").End(xlDown).Row
    Sheet2.Range("A4", "F" & maxRow).Copy (Sheet1.Cells(NextRow, 1))
    Sheet1.Range("A" & NextRow, "F" & Sheet1.Range("A6").End(xlDown).Row).Font.Color = Sheet1.Range("G7").Font.Color

' Add sheet3 Data
   NextRow = Sheet1.Range("A6").End(xlDown).Row + 1
   maxRow = Sheet3.Range("A4").End(xlDown).Row
   Sheet3.Range("A4", "F" & maxRow).Copy (Sheet1.Cells(NextRow, 1))
   Sheet1.Range("A" & NextRow, "F" & Sheet1.Range("A6").End(xlDown).Row).Font.Color = Sheet1.Range("G8").Font.Color

' Add sheet4 Data
   NextRow = Sheet1.Range("A6").End(xlDown).Row + 1
   maxRow = Sheet4.Range("A4").End(xlDown).Row
   Sheet4.Range("A4", "F" & maxRow).Copy (Sheet1.Cells(NextRow, 1))
   Sheet1.Range("A" & NextRow, "F" & Sheet1.Range("A6").End(xlDown).Row).Font.Color = Sheet1.Range("G9").Font.Color

' Add sheet5 Data
   NextRow = Sheet1.Range("A6").End(xlDown).Row + 1
   maxRow = Sheet5.Range("A4").End(xlDown).Row
   Sheet5.Range("A4", "F" & maxRow).Copy (Sheet1.Cells(NextRow, 1))
   Sheet1.Range("A" & NextRow, "F" & Sheet1.Range("A6").End(xlDown).Row).Font.Color = Sheet1.Range("G10").Font.Color



' Organize summary by index column
   NextRow = Sheet1.Range("A6").End(xlDown).Row
   Sheet1.Range("A6", "F" & NextRow).Sort Key1:=Range("A6:A1000"), Order1:=xlAscending

' align columns
    Sheet1.Range("A6", "F" & NextRow).HorizontalAlignment = Excel.Constants.xlLeft
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top