I recorded a macro to create one template from a certain table of data.
The issues are:
- The macro is limited to 44 rows (sometimes I deal with more than 5000):
would like the user insert the range and run the copy paste for that range. - The code is long and complex as it was recorded:
would like to clean it up.
I tried to implement a range input message. I don't know how to then use that range to run the copy paste.
Sub Macro1()
'
' Macro1 Macro
'
'
Range("A3:D3").Select
Selection.Copy
Range("W3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E3:H3").Select
Application.CutCopyMode = False
Selection.Copy
Range("W4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("I3").Select
Application.CutCopyMode = False
Selection.Copy
Range("S3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("R4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("J3").Select
Application.CutCopyMode = False
Selection.Copy
Range("Q3:Q4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("W3:W4").Select
Application.CutCopyMode = False
Selection.Copy
Range("P3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("W3").Select
Application.CutCopyMode = False
Selection.Copy
Range("AF4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("W4").Select
Application.CutCopyMode = False
Selection.Copy
Range("AF3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("AA3:AE4").Select
Application.CutCopyMode = False
Selection.Copy
Range("AA5").Select
ActiveSheet.Paste
Range("Q8").Select
End Sub
How the data are displayed and how I need to have those
The macro runs, but only for limited rows. I want it to run within the range specified by the user.