LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Copy Worksheet Help?

Michael,

For removing modules, see Chip Pearson's site. He has a page on working
with VBE objects and some code for removing modules:

http://www.cpearson.com/excel/vbe.htm

hth,

Doug

"Michael168" wrote in message
...

Hi! Tom,

It works great except it still copy all the modules from the original
workbook to the new workbook. How can I get rid the modules being
copied to the new workbook?

Thank you.

Tom Ogilvy wrote:
*Dim wkbk as Workbook
Dim fname as String

fname = Thisworkbook.Fullname
fname = Left(fname,len(fname)-4) & "_bak.xls"
Thisworkbook.SaveCopyas fname
set wkbk = workbooks.open( fname)

for each sh in wkbk.worksheets
sh.usedrange.formula = sh.usedrange.value
Next
Application.DisplayAlerts = False
wkbk.worksheets("Master").Delete
Application.DisplayAlerts = True
wkbk.close SaveChanges:=True

--
Regards,
Tom Ogilvy


"Michael168" wrote in
message
...

I have a workbook with 30 worksheets. One Master sheet and 29

report
sheets with initial name starting with 'R1' to 'R29' which

contains
links,formulas,functions,modules.

I want to export all the 29 report sheets to a new workbook without

the
links,formulas,functions,modules but just containing the values.I

am
doing this for reducing file size.

How to do this in vba?Please help.

Thanks.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/
*



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/





 
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 & paste worksheet with print settings into new worksheet Larry Ohio Excel Discussion (Misc queries) 1 December 23rd 09 05:17 PM
Copy Worksheet wont copy objects. Lincoln De Kalb Excel Worksheet Functions 7 January 12th 09 10:30 PM
Move/Copy or Copy/Insert worksheet? kjk Excel Discussion (Misc queries) 0 December 15th 06 02:40 PM
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 lukerush Excel Worksheet Functions 2 September 7th 06 05:05 PM
How? Macro to copy range to new worksheet, name new worksheet, loop Repoman Excel Programming 9 October 9th 03 01:45 PM


All times are GMT +1. The time now is 09:26 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"