Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Using a Macro that switches between workbooks

I have tried to create a macro that will copy and paste information between
two woorkbooks. One of these always has the same file name (and is a read
only template) where as the other will vary as it is used by different
individuals.

Can this be done?

Regards
Jorge
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Using a Macro that switches between workbooks

Try something like

Workbooks("Book5.xls").Worksheets("SHeet1").Range( "A1:A5").Copy _
Destination:=Workbooks("Book6.xls").Worksheets("Sh eet1").Range("A1")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jorge" wrote in message
...
I have tried to create a macro that will copy and paste
information between
two woorkbooks. One of these always has the same file name (and
is a read
only template) where as the other will vary as it is used by
different
individuals.

Can this be done?

Regards
Jorge



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Using a Macro that switches between workbooks

Thanks Chip,

But as I'm not a programmer I'm not sure if I was able to take advantage of
your advice. Would you posibly be able to be a little more exlplicit in my
case.

It didn't seem to help. In any case whatever I name the variable file there
is no way I can control what others will name theirs. The file is actually a
work time sheet so the file name will contain a date, which as you can
imagine changes regularly.

Regards
Jorge

"Chip Pearson" wrote:

Try something like

Workbooks("Book5.xls").Worksheets("SHeet1").Range( "A1:A5").Copy _
Destination:=Workbooks("Book6.xls").Worksheets("Sh eet1").Range("A1")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jorge" wrote in message
...
I have tried to create a macro that will copy and paste
information between
two woorkbooks. One of these always has the same file name (and
is a read
only template) where as the other will vary as it is used by
different
individuals.

Can this be done?

Regards
Jorge




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Using a Macro that switches between workbooks

cant you put the code in the file which the date changes and get it to open
and extract the data from the one that is always nammed the same



"Jorge" wrote:

Thanks Chip,

But as I'm not a programmer I'm not sure if I was able to take advantage of
your advice. Would you posibly be able to be a little more exlplicit in my
case.

It didn't seem to help. In any case whatever I name the variable file there
is no way I can control what others will name theirs. The file is actually a
work time sheet so the file name will contain a date, which as you can
imagine changes regularly.

Regards
Jorge

"Chip Pearson" wrote:

Try something like

Workbooks("Book5.xls").Worksheets("SHeet1").Range( "A1:A5").Copy _
Destination:=Workbooks("Book6.xls").Worksheets("Sh eet1").Range("A1")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jorge" wrote in message
...
I have tried to create a macro that will copy and paste
information between
two woorkbooks. One of these always has the same file name (and
is a read
only template) where as the other will vary as it is used by
different
individuals.

Can this be done?

Regards
Jorge




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Using a Macro that switches between workbooks

Rich,

It doesn't work that way. The reason being that firstly it's protected
worksheet with only specific cells unprotected. Secondly, as the macro needs
to refer back to the variable workbook to copy information, once the filename
changes the macro is no longer viable. This is the hurdle, if at all
possible, I'm trying to overcome.

Regards
Jorge


"Rich Mcc" wrote:

cant you put the code in the file which the date changes and get it to open
and extract the data from the one that is always nammed the same



"Jorge" wrote:

Thanks Chip,

But as I'm not a programmer I'm not sure if I was able to take advantage of
your advice. Would you posibly be able to be a little more exlplicit in my
case.

It didn't seem to help. In any case whatever I name the variable file there
is no way I can control what others will name theirs. The file is actually a
work time sheet so the file name will contain a date, which as you can
imagine changes regularly.

Regards
Jorge

"Chip Pearson" wrote:

Try something like

Workbooks("Book5.xls").Worksheets("SHeet1").Range( "A1:A5").Copy _
Destination:=Workbooks("Book6.xls").Worksheets("Sh eet1").Range("A1")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jorge" wrote in message
...
I have tried to create a macro that will copy and paste
information between
two woorkbooks. One of these always has the same file name (and
is a read
only template) where as the other will vary as it is used by
different
individuals.

Can this be done?

Regards
Jorge





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
2 windows for workbook - Macro switches worksheet Hari Excel Discussion (Misc queries) 1 June 12th 06 11:20 PM
Macros with switches vishu Excel Programming 4 July 14th 05 11:57 AM
Don't show sheet switches when running macro Ben Excel Programming 4 May 25th 05 02:10 PM
Macro for Filter Switches ... Maybe??? Ken Excel Discussion (Misc queries) 4 February 25th 05 05:30 PM
Filter Switches vs Macro? Ken Excel Discussion (Misc queries) 3 February 24th 05 10:31 PM


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

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"