A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Excel VBA - Copying Sheets to Closed Workbooks



 
 
Thread Tools Display Modes
  #1  
Old March 25th, 2004, 04:46 PM
Ron de Bruin
external usenet poster
 
Posts: n/a
Default Excel VBA - Copying Sheets to Closed Workbooks

Try this aj
http://www.rondebruin.nl/copy4.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"ajlove20 " wrote in message ...
Hi,

I just created a new sheet called "Review" on a workbook that I am
working on and I would like to copy the complete sheet to my other
workbooks. There are about 40 to 50 other workbooks and I don't want
to have to open each of them to create a new sheet. Is there a VBA
code I can use that will copy this sheet into each of the other
workbooks? Thank you.

aj


---
Message posted from http://www.ExcelForum.com/



  #2  
Old March 25th, 2004, 05:41 PM
Ron de Bruin
external usenet poster
 
Posts: n/a
Default Excel VBA - Copying Sheets to Closed Workbooks

Hi

Does the sheet ESTIMATE exist in all your workbooks?

--
Regards Ron de Bruin
http://www.rondebruin.nl


"ajlove20 " wrote in message ...
Hi Ron,

Thank you for your help. It worked fine, but there was one thing. I
had formulas in the sheet i wanted to copy that are related to that its
own workbook. When I copied it to the other files, the formula
reference the original workbook. Here is an example of what I am
talking about. The original workbook (example2.xls) had a formula that
looked like this:

=+ESTIMATE!C4

One of the workbooks that the sheet copied to had a formula that looked
like this:

=+[example2.xls]ESTIMATE!C4

I just wanted the new sheet to reference its own workbook to complete
the formula.

Thank you.


---
Message posted from http://www.ExcelForum.com/



  #3  
Old March 25th, 2004, 05:59 PM
Ron de Bruin
external usenet poster
 
Posts: n/a
Default Excel VBA - Copying Sheets to Closed Workbooks

If the sheet exist in all your workbook try this
(untested)

Run the macro Test on the sheet you want to copy
All formulas are text now.

Sub test()
For Each cell In Cells.SpecialCells(xlCellTypeFormulas)
cell.Value = "'" & cell.Formula
Next
End Sub


Run the example macro on my site that you used
Only use the code that is comented also now

With ActiveSheet.UsedRange
.Value = .Value
End With


Run this macro to restore your original worksheet(Sheet that you copy) when you ready.

Sub test2()
With ActiveSheet.UsedRange
..Value = .Value
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"ajlove20 " wrote in message ...
yeah, ESTIMATE exists in all the workbooks


---
Message posted from http://www.ExcelForum.com/



  #4  
Old March 25th, 2004, 06:19 PM
Ron de Bruin
external usenet poster
 
Posts: n/a
Default Excel VBA - Copying Sheets to Closed Workbooks

You are welcome



--
Regards Ron de Bruin
http://www.rondebruin.nl


"ajlove20 " wrote in message ...
Hi Ron,

Thank you so much. It worked perfectly. I appreciate you taking time
to help me. Thanks again.

aj


---
Message posted from http://www.ExcelForum.com/



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:45 AM.


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