M
Mike Cross
Can anyone tell me why my file which was about 4MB in
size grew to like 7MB by basically writing one macro -
see Macro below?
The Macro takes a list of data in the workbook and copies
the formula down for approx 8000 rows, then copies and
pastes a value that was calculated by these formulas,
sorts it (it is basically a query on a list of data based
on a users selection) then it deletes the formula again
(This pasting and deleting of the formula was an attempt
to shrink the file size)
Thanks in advance for your repsonse!
Regards,
Mike
Application.ScreenUpdating = False
Range("S5:V5").Select
Selection.Copy
Range("S6:V8000").Select
ActiveSheet.Paste
Range("V5:W8000").Select
Selection.Copy
Range("g17").Select
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
If ActiveSheet.Protection.AllowSorting = False Then
ActiveSheet.Protect AllowSorting:=True
End If
Selection.Sort Key1:=Range("g17"),
Order1:=xlDescending, Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("S6:V8000").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("G10000").Select
Application.ScreenUpdating = True
End Sub
size grew to like 7MB by basically writing one macro -
see Macro below?
The Macro takes a list of data in the workbook and copies
the formula down for approx 8000 rows, then copies and
pastes a value that was calculated by these formulas,
sorts it (it is basically a query on a list of data based
on a users selection) then it deletes the formula again
(This pasting and deleting of the formula was an attempt
to shrink the file size)
Thanks in advance for your repsonse!
Regards,
Mike
Application.ScreenUpdating = False
Range("S5:V5").Select
Selection.Copy
Range("S6:V8000").Select
ActiveSheet.Paste
Range("V5:W8000").Select
Selection.Copy
Range("g17").Select
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
If ActiveSheet.Protection.AllowSorting = False Then
ActiveSheet.Protect AllowSorting:=True
End If
Selection.Sort Key1:=Range("g17"),
Order1:=xlDescending, Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("S6:V8000").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("G10000").Select
Application.ScreenUpdating = True
End Sub