Macro code help - paste function not working

March 25, 2011 at 01:22:25
Specs: Windows XP
I am trying to use a macro to "database" information entered onto a form when a button/control is pressed. I have gotten every line of code to work except for the paste function line and cannot figure out why. It will work if I use Select on the field and then paste, but I am trying to keep the database page hidden. Any help would be appreciated.

Sheets("Database").Rows("2:2").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Sheets("Mix Production").Range("A9:F9").Copy
Sheets("Database").Range("A2").Paste
Sheets("Mix Production").Range("A9:F9").ClearContents
ActiveWorkbook.Save


See More: Macro code help - paste function not working

Report •

#1
March 25, 2011 at 03:24:12
Try this format:

Worksheets("Sheet1").Range("a1:f1").Copy
ActiveSheet.Paste Destination:=Worksheets("Sheet2").Range("a1")


Report •

#2
March 25, 2011 at 03:32:21
Worked perfectly in that format. Thank you very much for the assistance!

Onto the next project now.


Report •
Related Solutions


Ask Question