Sub data_creator()
'
' Data creator
Dim LR As Long
Dim LastCell As Long
Dim Lastrow As Long
Dim OpenA As Workbook, OpenB As Workbook
Dim NewFN As String
Set OpenA = ActiveWorkbook
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xlsm), *.xlsm", Title:="Please select a file")
If NewFN = "False" Then
' They pressed Cancel
MsgBox "Stopping because you did not select a file"
Exit Sub
Else
End If
Workbooks.Open Filename:=NewFN
Set OpenB = Workbooks(Workbooks.Count)
OpenA.Activate
Sheets("data").Select
Lastrow = ActiveSheet.UsedRange.Rows.Count
Range(Cells(2, 1), Cells(Lastrow, 20)).Select
Selection.ClearContents
'01
'Part1
OpenB.Activate
Sheets("01").Select
Range("A1:S1").Select
Selection.Copy
OpenA.Activate
Sheets("data").Select
ActiveSheet.Range("A65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
OpenB.Activate
Range("A3:R62").Select
Application.CutCopyMode = False
Selection.Copy
OpenA.Activate
ActiveSheet.Range("C65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E:E").SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.ClearContents
Lastrow = ActiveSheet.UsedRange.Rows.Count
LastCell = Range("A1:A65536").End(xlUp).Row
ActiveSheet.Range("A65536").End(xlUp).Offset(0, 0).Select
Selection.Copy
LR = Range("C" & Rows.Count).End(xlUp).Row
Range(Range("A" & Rows.Count).End(xlUp).Offset(0, 0), Range("A" & LR)) = Range("A65536").End(xlUp).Offset(0, 0)
ActiveSheet.Paste
'Part2
OpenB.Activate
Sheets("01").Select
Range("A65:S65").Select
Selection.Copy
OpenA.Activate
Sheets("data").Select
ActiveSheet.Range("A65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
OpenB.Activate
Range("A67:R126").Select
Application.CutCopyMode = False
Selection.Copy
OpenA.Activate
ActiveSheet.Range("C65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E:E").SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.ClearContents
Lastrow = ActiveSheet.UsedRange.Rows.Count
LastCell = Range("A1:A65536").End(xlUp).Row
ActiveSheet.Range("A65536").End(xlUp).Offset(0, 0).Select
Selection.Copy
LR = Range("C" & Rows.Count).End(xlUp).Row
Range(Range("A" & Rows.Count).End(xlUp).Offset(0, 0), Range("A" & LR)) = Range("A65536").End(xlUp).Offset(0, 0)
'Part3
OpenB.Activate
Sheets("01").Select
Range("A129:S129").Select
Selection.Copy
OpenA.Activate
Sheets("data").Select
ActiveSheet.Range("A65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
OpenB.Activate
Range("A131:R190").Select
Application.CutCopyMode = False
Selection.Copy
OpenA.Activate
ActiveSheet.Range("C65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E:E").SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.ClearContents
Lastrow = ActiveSheet.UsedRange.Rows.Count
LastCell = Range("A1:A65536").End(xlUp).Row
ActiveSheet.Range("A65536").End(xlUp).Offset(0, 0).Select
Selection.Copy
LR = Range("C" & Rows.Count).End(xlUp).Row
Range(Range("A" & Rows.Count).End(xlUp).Offset(0, 0), Range("A" & LR)) = Range("A65536").End(xlUp).Offset(0, 0)