Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy and paste using code from workbook to workbook | Excel Discussion (Misc queries) | |||
Selecting data from 1 workbook to copy and paste to a 2nd workbook | Excel Programming | |||
automate copy and paste whole workbook to new workbook | Excel Programming | |||
Need a macro to copy a range in one workbook and paste into another workbook | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming |