Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy From One WorkbookTo Another
I recorded a macro that copies cells from one workbook(the name never
changes) to another workbook(the name changes each time a report is generated), but I realized the name of the report/workbook is in the macro. How do I change the name to indicate that it is to paste it into whatever report I'm working on or is there a macro that does away with this problem? Thanks!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy From One WorkbookTo Another
Dear Lilbit:
You can try using a a custom form, inputboxs, calling the macro from the sheet it is to be copies to or use cells in worksheet to record the workbook and worksheet. The easiest is the call the macro from the sheet that the cells are to be copies to: ' copy cell A1 on sheet 1 from the fixed workbook FROM.XLS to the active sheet. sub copycell() activesheet.range("A1") = workbook("FROM.XLS").worksheets("Sheet 1").range("A1) end sub I leave the other methods for your inverstigation. -- HTHs Martin "Lilbit" wrote: I recorded a macro that copies cells from one workbook(the name never changes) to another workbook(the name changes each time a report is generated), but I realized the name of the report/workbook is in the macro. How do I change the name to indicate that it is to paste it into whatever report I'm working on or is there a macro that does away with this problem? Thanks!! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy From One WorkbookTo Another
Hi Lilbit
Play with this, you can use Application.ScreenUpdating = False/true Dim wsName As String wsName = InputBox(Prompt:="Paste to workbook", Title:="workbook name", Default:="") Workbooks(wsName).Worksheets(1).Activate or use copy, destination:=Workbooks(wsName).Worksheets(1).range ("A1") Regards Yngve |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy From One WorkbookTo Another
Thanks very very much!!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming | |||
How copy format, font, color and border without copy/paste? | Excel Programming |