S
soumya garimella via OfficeKB.com
Hi,
The basic problem for me is I don't know much about VBA or macros, as I am into PeopleSoft. When I am opening an excel report which is generated by a peoplesoft application. I am getting an error after I enable the macros and hit no to another warning to make any changes to workbook, I am immediately get this error,
like
Run Time Error:9
Sub-Script out of range
This is the Code where it is showing when I tried to debug it.
'* This function hides the current quarter column when the worksheet is opened if the AsOfDate month is not a quarter-ending month.
'***********************************************************************
Sub Auto_Open()
If Month(Worksheets("Report").Range("AsOfDate").Value) Mod 3 > 0 Then
HideCurrentQuarter
End If
End Sub
As to what i understood is that it works properly for 3,6,9,12 months as they are the quarter ending months. But it is not working properly for other months....like oct, nov..etc. what should i do to make it work properly. So please someody who knows it better help me out in this!!!!!
Your Time and Consideration would be appreciated.
Thanks
Soumya
*****************************************
* This message was posted via http://www.officekb.com
*
* Report spam or abuse by clicking the following URL:
* http://www.officekb.com/Uwe/Abuse.aspx?aid=e116502162274f46bfb4ce441d4b2b10
*****************************************
The basic problem for me is I don't know much about VBA or macros, as I am into PeopleSoft. When I am opening an excel report which is generated by a peoplesoft application. I am getting an error after I enable the macros and hit no to another warning to make any changes to workbook, I am immediately get this error,
like
Run Time Error:9
Sub-Script out of range
This is the Code where it is showing when I tried to debug it.
'* This function hides the current quarter column when the worksheet is opened if the AsOfDate month is not a quarter-ending month.
'***********************************************************************
Sub Auto_Open()
If Month(Worksheets("Report").Range("AsOfDate").Value) Mod 3 > 0 Then
HideCurrentQuarter
End If
End Sub
As to what i understood is that it works properly for 3,6,9,12 months as they are the quarter ending months. But it is not working properly for other months....like oct, nov..etc. what should i do to make it work properly. So please someody who knows it better help me out in this!!!!!
Your Time and Consideration would be appreciated.
Thanks
Soumya
*****************************************
* This message was posted via http://www.officekb.com
*
* Report spam or abuse by clicking the following URL:
* http://www.officekb.com/Uwe/Abuse.aspx?aid=e116502162274f46bfb4ce441d4b2b10
*****************************************