Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Copy From One WorkbookTo Another

Thanks very very much!!

Reply
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 versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM
How copy format, font, color and border without copy/paste? Michel[_3_] Excel Programming 1 November 5th 03 04:43 PM


All times are GMT +1. The time now is 02:03 AM.

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

About Us

"It's about Microsoft Excel"