D
divareed
Hello I need help with using a VBA code to merge data from a range of
worksheets in a workbook. I have several worksheets that are formatted the
same except they may have a different amount of rows of data on each
spreadsheet and they are named for each of my employees. When I run the
Macro, it is giving me all of the details, columns and rows from the 1st
sheet only, Sonia G then it only gives me the information in colums A, B, C,
E, F, G, I from the other work sheets. However, all of the worksheets have
information in columns A thru AA. I used the following code for a Summary
Sheet by Bernie D...
Sub UpdateSummarySheet()
Dim mySht As Worksheet
Dim myRange As Range
On Error Resume Next
Application.DisplayAlerts = False
Worksheets("Summary Sheet").Delete
Worksheets.Add.Name = "Summary Sheet"
Application.DisplayAlerts = True
'Data transfer summarization
With Sheets("Sonia G")
Set myRange = .Range("A1").CurrentRegion
myRange.Resize(myRange.Rows.Count - 1, _
myRange.Columns.Count).Copy _
Worksheets("Summary Sheet").Range("A1")
End With
For Each mySht In Sheets(Array("Lisa P", _
"Javier B", "Priscilla C", "Michelle T"))
Set myRange = mySht.Range("A1").CurrentRegion
myRange.Offset(1, 0).Resize(myRange.Rows.Count - 2, _
myRange.Columns.Count).Copy _
Worksheets("Summary Sheet").Range("A65536").End(xlUp)(2)
Next mySht
End Sub
I have used several codes today and the result is still the same. Can
someone please help! Any help is appreciated.
Thanks!
worksheets in a workbook. I have several worksheets that are formatted the
same except they may have a different amount of rows of data on each
spreadsheet and they are named for each of my employees. When I run the
Macro, it is giving me all of the details, columns and rows from the 1st
sheet only, Sonia G then it only gives me the information in colums A, B, C,
E, F, G, I from the other work sheets. However, all of the worksheets have
information in columns A thru AA. I used the following code for a Summary
Sheet by Bernie D...
Sub UpdateSummarySheet()
Dim mySht As Worksheet
Dim myRange As Range
On Error Resume Next
Application.DisplayAlerts = False
Worksheets("Summary Sheet").Delete
Worksheets.Add.Name = "Summary Sheet"
Application.DisplayAlerts = True
'Data transfer summarization
With Sheets("Sonia G")
Set myRange = .Range("A1").CurrentRegion
myRange.Resize(myRange.Rows.Count - 1, _
myRange.Columns.Count).Copy _
Worksheets("Summary Sheet").Range("A1")
End With
For Each mySht In Sheets(Array("Lisa P", _
"Javier B", "Priscilla C", "Michelle T"))
Set myRange = mySht.Range("A1").CurrentRegion
myRange.Offset(1, 0).Resize(myRange.Rows.Count - 2, _
myRange.Columns.Count).Copy _
Worksheets("Summary Sheet").Range("A65536").End(xlUp)(2)
Next mySht
End Sub
I have used several codes today and the result is still the same. Can
someone please help! Any help is appreciated.
Thanks!