Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
maxzsim
 
Posts: n/a
Default using programming to copy worksheets data only

Hi,

How can i use programming to copy all the worksheets from an excel file to
another excel file as data only (i do not want the formulas to be copied as
formulas but as data) ?

i can see there's copydatafromrecordset but it's not suitable and also there
the copy method from worksheet (this will copy the formula)

kindly advice

tks & rdgs



  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default using programming to copy worksheets data only

This copies the sheet (as-is) preserving formats and page setups and even the
code behind the worksheet. Then it comes back and pastes as values.

Option Explicit
Sub testme()

Dim fWks As Worksheet
Dim tWks As Worksheet
Dim fWkbk As Workbook
Dim tWkbk As Workbook

Set fWkbk = Workbooks("book1.xls")
Set tWkbk = Workbooks("book2.xls")

For Each fWks In fWkbk.Worksheets
fWks.Copy _
after:=tWkbk.Sheets(tWkbk.Sheets.Count)
Set tWks = ActiveSheet
fWks.Cells.Copy
tWks.Range("a1").PasteSpecial Paste:=xlPasteValues
Next fWks

Application.CutCopyMode = False

End Sub


It might not do what you want--if you didn't want all that other stuff coming
with it.

maxzsim wrote:

Hi,

How can i use programming to copy all the worksheets from an excel file to
another excel file as data only (i do not want the formulas to be copied as
formulas but as data) ?

i can see there's copydatafromrecordset but it's not suitable and also there
the copy method from worksheet (this will copy the formula)

kindly advice

tks & rdgs


--

Dave Peterson
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
Master worksheet automatically enters data into sub worksheets Ken Excel Discussion (Misc queries) 1 November 1st 05 10:36 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
Printing data validation scenarios SJC Excel Worksheet Functions 14 July 24th 05 12:43 AM
sorting data in linked worksheets Allyson Excel Discussion (Misc queries) 0 June 8th 05 11:25 PM
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM


All times are GMT +1. The time now is 09:17 PM.

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"