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

Dim sh as Worksheet
Dim rng as Range
Dim varr as Variant
On Error Resume Next
Kill "C:\Backup\MyData.xls"
On Error goto 0
ActiveWorkbook.SaveCopyAs Filename:="C:\Backup\Mydata.xls"
workbooks.Open "C:\Backup\MyData.xls"
for each sh in ActiveWorkbook.Worksheets
if sh.Name < "Data" then
application.DisplayAlerts = False
sh.Delete
Application.DisplayAlerts = True
end if
Next
with worksheets("Data")
set rng = .Range("A1").CurrentRegion
vArr = rng.value
.Usedrange.Clearcontents
rng.Value = varr
End With
Activeworkbook.Close Savechanges:=True

--
Regards,
Tom Ogilvy

"Ernst Guckel" wrote in message
...
Hello,

I have a spreadsheet that I need to export selected data to a file. It
can be a spreadsheet. My file is over 1mb and I just need to export the
actual values of a particular range to a backup file. Any ideas?

Ernst.