View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Out of Stack Space ... Recorded Macros

Is your workbook set to manual calculate? If not, then I'd just delete the
offending Calculate statement from the code.

Although I doubt if it has anything to do with it, the code always works
with the ActiveSheet. That is, the sheet currently selected. Is the sheet
this code was designed for the active sheet when it's run? Again, shouldn't
have anything to do with out of stack problem - that's usually caused by an
almost infinite loop reiteratively calling a routine/process.

"Ken" wrote:

SS Calculation set to "Manual" ... Here is my Recorded Code ... I am getting
"Out of Stack Space" message on "Calculate" ... However, SS allows me to F9
Calculate???

Sub Sort_Type_Rec_Ascend()
'
' Sort_Type_Rec_Ascend Macro
'

'
a = MsgBox("SORT ... Type Record (Ascending)?", vbYesNo, "ATTENTION!")
If a = 7 Then Exit Sub

ActiveSheet.Unprotect

Range("A2:D22").Select
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
True, AllowFormattingRows:=True, AllowSorting:=True,
AllowFiltering:=True

Calculate

Range("O40").Select

End Sub


Thanks ... Kha

"Ken" wrote:

Excel2003 ... I know nothing of writing Code ... I Record Macros only ...

That said ... SS working fine until I started getting error (Out of Stack
Space)

Is there "HELP" for me??? ... Thanks ... Kha