Thread: Paste Values
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Paste Values

Dim bk as Workbook, sh as Worksheet
bk = Workbooks.Open("C:\data\Myfiles.xls")
for each sh in bk.worksheets
sh.UsedRange.Formula = sh.UsedRange.Value
Next
bk.close Savechanges:=True

--
Regards,
Tom Ogilvy


"STEVEB" wrote in
message ...

Does anyone have any suggestions for a Macro that would open a workbook
and paste values for all sheets in the workbook?

My current Macro works great when the sheets in the workbook are
consistent. However, the worksheets names and number of sheets in the
workbook are updated weekly and frequently change from the prior week.


Any help would be greatly appreciated.


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile:

http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=398263