This should do as I described. FAST. Change filename to suit. You will need
to establish the reference first.
'You will need to make a reference to Microsoft Visual Basics for
'Applications Extensibility under Tools>References
Sub copyclean()
'cleans formulas
For Each ws In Worksheets
ws.UsedRange.Value = ws.UsedRange.Value
Next ws
'savesAS
ActiveWorkbook.SaveAs Filename:="200905011_B", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
DeleteAllVBA
End Sub
Sub DeleteAllVBA()
'You will need to make a reference to Microsoft Visual Basics for
'Applications Extensibility under Tools>References
Dim VBComp As VBIDE.VBComponent
Dim VBComps As VBIDE.VBComponents
Set VBComps = ActiveWorkbook.VBProject.VBComponents
For Each VBComp In VBComps
Select Case VBComp.Type
Case vbext_ct_StdModule, vbext_ct_MSForm, _
vbext_ct_ClassModule
VBComps.Remove VBComp
Case Else
With VBComp.CodeModule
.DeleteLines 1, .CountOfLines
End With
End Select
Next VBComp
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Don Guillett" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Perhaps a macro that change all formulas to values>saves as>deletes
> macros.
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "LiAD" <(E-Mail Removed)> wrote in message
> news:419679C9-93B9-4BA8-A9B0-(E-Mail Removed)...
>> Hi,
>>
>> I have a file with about 10 worksheets in it, each with a lot of data,
>> formulas, macros etc - as a result the file is a chunky 16MB.
>>
>> In order not to take up huge amounts of space when the file is updated
>> every
>> week I could like to save all the data formatted in exactly the same way
>> etc
>> but without the formulas and macros into another separate file.
>>
>> I can create a macro to do a copy/paste special values into another pre
>> assigned file with the same layout and no macros - thats no problem.
>> However
>> it is, or will be a long long macro which means if I need to change it
>> will
>> be a nightmare.
>>
>> Is there any quicker way of doing this?
>>
>> Thanks
>> LiAD
>