LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Copy/Paste from one workbook to another workbook

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy and paste using code from workbook to workbook bigdaddy3 Excel Discussion (Misc queries) 2 September 14th 05 11:06 AM
Selecting data from 1 workbook to copy and paste to a 2nd workbook JackSpam Excel Programming 2 July 20th 05 02:33 AM
automate copy and paste whole workbook to new workbook Leslie Excel Programming 4 July 1st 05 04:40 PM
Need a macro to copy a range in one workbook and paste into another workbook Paul Excel Programming 8 July 1st 04 07:42 AM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM


All times are GMT +1. The time now is 08:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"