Summary VBA

CLAIREW1871

New Member
Joined
Jan 15, 2020
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hello,

I was wondering if anyone can help?

I have 8 identical worksheets (numbered 2-8)in a workbook that I need to create an identical summary from. My columns are A - S.

I do have a code but I have a couple of questions:

How do I get the header (In A1 in all sheets) to appear only once on my summary page?

Is there a way that I can delete the previous summary each time a new one is created?


My code is:


Sub Combine()

Dim J As Integer

On Error Resume Next

Sheets(1).Select

Worksheets.Add ' add a sheet in first place

Sheets(1).Name = "Combined"

Sheets(2).Activate

Range("A2").EntireRow.Select

Selection.Copy Destination:=Sheets(1).Range("A2")

For J = 2 To 8 ' from sheet 2 to last sheet

Sheets(J).Activate ' make the sheet active

Range("A2").Select

Selection.CurrentRegion.Select ' select all cells in this sheets

Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select

Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)

Next

End Sub



Many thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi & welcome to MrExcel.
How about
VBA Code:
Sub clairew()
   Dim Ws As Worksheet
   
   Sheets.Add(Sheets(1)).Name = "Combined"
   With Sheets("Combined")
      Sheets(1).Rows(1).Copy .Range("A1")
      For Each Ws In Worksheets
         If Ws.Name <> "Combined" Then
            Ws.UsedRange.Offset(1).Copy .Range("A" & Rows.Count).End(xlUp).Offset(1)
         End If
      Next Ws
   End With
End Sub
 
Upvote 0
It skips a whole lot of data where column(a) is empty by columns (b),(c), .. etc contain data. what can i do to fix that? apart from inserting a new column(a) in all my sheets contaning row(id's) or some other data for each row ?
 
Upvote 0
Please start a thread of your own, giving full details. Thanks
 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,945
Members
449,095
Latest member
nmaske

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