I am attempting to copy values in columns to a separate worksheet into three columns. As you can see, the values are all on the same worksheet (Travel Expense Codes) and are all being copied to the worksheet (Data Entry Summary). On the Travel Expense Codes worksheet, There are a total of twelve columns and I need to copy them in sets of 3 columns because of how the data is setup, to the 'Data Entry Summary' worksheet into only three columns. I hope that makes sense but I am going to use the 'Data Entry Summary' worksheet to create a summary of like items. This is currently a very manual process that turns many rows of data into approximately 5-6 rows of 3 pieces of data for data entry into our system.
Okay, enough summary, I am attempting to copy the first 3 columns to the columns on the separate worksheet. Then the second 3 columns to the columns on the separate worksheet starting at the first blank row, then the third 3 columns, and so on. However, when I run my macro, I am getting a Run-time 1004 Select method of range class failed. Does anyone know what this means and what I need to do with the following code to fix it? Any help is greatly appreciated!
Okay, enough summary, I am attempting to copy the first 3 columns to the columns on the separate worksheet. Then the second 3 columns to the columns on the separate worksheet starting at the first blank row, then the third 3 columns, and so on. However, when I run my macro, I am getting a Run-time 1004 Select method of range class failed. Does anyone know what this means and what I need to do with the following code to fix it? Any help is greatly appreciated!
Code:
Sub DataEntrySummary()
'''DataEntrySummary creation Keyboard Shortcut: ctrl Shift + Q'''
Dim LastRow As Long
Worksheets("Data Entry Summary").Visible = True
Worksheets("Travel Expense Codes").Range("A2:C58").Select
Selection.Copy
Sheets("Data Entry Summary").Select
Range("A2").Select
ActiveSheet.Paste
Worksheets("Travel Expense Codes").Range("D2:F58").Select
Selection.Copy
Sheets("Data Entry Summary").Select
'Range("A2").Select
'ActiveSheet.Paste
Cells(Range("a1000000").End(xlUp).row + 1, 3).PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Worksheets("Travel Expense Codes").Range("G2:I58").Select
Selection.Copy
Sheets("Data Entry Summary").Select
'Range("A2").Select
'ActiveSheet.Paste
Cells(Range("a1000000").End(xlUp).row + 1, 3).PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Worksheets("Travel Expense Codes").Range("J2:L58").Select
Selection.Copy
Sheets("Data Entry Summary").Select
'Range("A2").Select
'ActiveSheet.Paste
Cells(Range("a1000000").End(xlUp).row + 1, 3).PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub
Last edited by a moderator: