Afternoon all,
I really need some help with this one, been on it all day to no avail.
I am looking to build a macro that will copy a range from once sheet and, paste it to another sheet on the next blank row then auto fill down to a destination based on the contents of the adjacent column.
This is what i have:
Sub Alan()
Range("Description").Copy
Sheets("Raw data").Range("E" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Application.ScreenUpdating = True
Range("Info").Copy
Sheets("Raw data").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Application.CutCopyMode = False
Application.ScreenUpdating = True
Sheets("Raw data").Select
Selection.AutoFill Destination:=Range("A2:D" & Range("E" & Rows.Count).End(xlUp).Row)
Sheets("Form").Select
Range("Description").ClearContents
Range("Info").ClearContents
End Sub
This works fine the first time, but on the next submission it will paste to the next available row however it will not AutoFill and i get the Run-time error '1004': AutoFill method of Range class failed and highlights this section of the code:
Selection.AutoFill Destination:=Range("A2:D" & Range("E" & Rows.Count).End(xlUp).Row)
Any suggestions would be greatly appreciated to save me going insane.
Thanks
I really need some help with this one, been on it all day to no avail.
I am looking to build a macro that will copy a range from once sheet and, paste it to another sheet on the next blank row then auto fill down to a destination based on the contents of the adjacent column.
This is what i have:
Sub Alan()
Range("Description").Copy
Sheets("Raw data").Range("E" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Application.ScreenUpdating = True
Range("Info").Copy
Sheets("Raw data").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Application.CutCopyMode = False
Application.ScreenUpdating = True
Sheets("Raw data").Select
Selection.AutoFill Destination:=Range("A2:D" & Range("E" & Rows.Count).End(xlUp).Row)
Sheets("Form").Select
Range("Description").ClearContents
Range("Info").ClearContents
End Sub
This works fine the first time, but on the next submission it will paste to the next available row however it will not AutoFill and i get the Run-time error '1004': AutoFill method of Range class failed and highlights this section of the code:
Selection.AutoFill Destination:=Range("A2:D" & Range("E" & Rows.Count).End(xlUp).Row)
Any suggestions would be greatly appreciated to save me going insane.
Thanks