Simple Copy/Paste from one workbook to another workbook

B

becuzimmike

I am trying to do a simple Copy and Paste macro from one workbook to
certain cells in another workbook. I have the basics but I am getting
errors that the sub or fuction is not defined. Here is what I have so
far:

Sub CopyPaste()

Workbook("Customer database.xls").Activate
Rows("3:3").Select
Selection.Insert Shift:=xlDown
Selection.Clear
Workbook("Invoice template.xls").Activate
Range("B7:B13").Select
Selection.Copy
Workbook("Customer database.xls").Activate
Range("A3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Workbook("Invoice template.xls").Activate
Range("B4").Select
Application.CutCopyMode = False
Selection.Copy
Workbook("Customer database.xls").Activate
Range("K3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Workbook("Invoice template.xls").Activate
Range("B5").Select
Selection.Copy

Range("J3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Columns("K:K").EntireColumn.AutoFit
Columns("J:J").EntireColumn.AutoFit
Columns("I:I").EntireColumn.AutoFit
Columns("H:H").EntireColumn.AutoFit
Columns("G:G").EntireColumn.AutoFit
Columns("F:F").EntireColumn.AutoFit
Columns("E:E").EntireColumn.AutoFit
Columns("D:D").EntireColumn.AutoFit
Columns("C:C").EntireColumn.AutoFit
Columns("B:B").EntireColumn.AutoFit
Columns("A:A").EntireColumn.AutoFit

End Sub

Thanks,

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top