Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
Is there a way to start this macro by it self for the whole mont of april
2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
So you want the Headings to continually toggle on and off for a whole
month? Won't that be a bit irritating? I'm sure that's not what you mean, but perhaps you'd like to restate your question.... Tim. "Antonyo" wrote in message ... Is there a way to start this macro by it self for the whole mont of april 2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
I Have 12 sheets, one for every month of the year
Jan is Sheet 1,Feb Is Sheet 2 and so on I need the Headings to show on march (Sheet 3 ) if is march if is April (Sheet 4) I need march off and April on Is this Possible Antonyo "Dave Peterson" escribió en el mensaje ... If you name the macro auto_open, it'll run when you open the workbook. Then you can check the date to see if it should continue: Sub auto_open() if format(date,"mmyyyy") = "042005" then ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings else 'do nothing end if End Sub Antonyo wrote: Is there a way to start this macro by it self for the whole mont of april 2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
You have 12 sheets named: Jan, Feb, Mar, ..., Dec?
If yes, then how about something like: Option Explicit Sub auto_open() Dim wks As Worksheet Dim CurMonth As String CurMonth = Format(Date, "mmm") For Each wks In ThisWorkbook.Worksheets With wks .Select ActiveWindow.DisplayHeadings _ = CBool((LCase(.Name) = LCase(CurMonth))) End With Next wks End Sub Although I do agree with Tim. The first thing I would do is show those headers. Antonyo wrote: I Have 12 sheets, one for every month of the year Jan is Sheet 1,Feb Is Sheet 2 and so on I need the Headings to show on march (Sheet 3 ) if is march if is April (Sheet 4) I need march off and April on Is this Possible Antonyo "Dave Peterson" escribió en el mensaje ... If you name the macro auto_open, it'll run when you open the workbook. Then you can check the date to see if it should continue: Sub auto_open() if format(date,"mmyyyy") = "042005" then ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings else 'do nothing end if End Sub Antonyo wrote: Is there a way to start this macro by it self for the whole mont of april 2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub -- Dave Peterson -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
Hello Again
I have 12 Sheets named - ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 Regards Antonyo "Dave Peterson" escribió en el mensaje ... You have 12 sheets named: Jan, Feb, Mar, ..., Dec? If yes, then how about something like: Option Explicit Sub auto_open() Dim wks As Worksheet Dim CurMonth As String CurMonth = Format(Date, "mmm") For Each wks In ThisWorkbook.Worksheets With wks .Select ActiveWindow.DisplayHeadings _ = CBool((LCase(.Name) = LCase(CurMonth))) End With Next wks End Sub Although I do agree with Tim. The first thing I would do is show those headers. Antonyo wrote: I Have 12 sheets, one for every month of the year Jan is Sheet 1,Feb Is Sheet 2 and so on I need the Headings to show on march (Sheet 3 ) if is march if is April (Sheet 4) I need march off and April on Is this Possible Antonyo "Dave Peterson" escribió en el mensaje ... If you name the macro auto_open, it'll run when you open the workbook. Then you can check the date to see if it should continue: Sub auto_open() if format(date,"mmyyyy") = "042005" then ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings else 'do nothing end if End Sub Antonyo wrote: Is there a way to start this macro by it self for the whole mont of april 2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub -- Dave Peterson -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
They're named ",1", ",2", ..., ",12"????
That looks highly unusual to me. Are they named "sheet 1" (with a space), "sheet1" (no space) or just "1" (no sheet)? Antonyo wrote: Hello Again I have 12 Sheets named - ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 Regards Antonyo "Dave Peterson" escribió en el mensaje ... You have 12 sheets named: Jan, Feb, Mar, ..., Dec? If yes, then how about something like: Option Explicit Sub auto_open() Dim wks As Worksheet Dim CurMonth As String CurMonth = Format(Date, "mmm") For Each wks In ThisWorkbook.Worksheets With wks .Select ActiveWindow.DisplayHeadings _ = CBool((LCase(.Name) = LCase(CurMonth))) End With Next wks End Sub Although I do agree with Tim. The first thing I would do is show those headers. Antonyo wrote: I Have 12 sheets, one for every month of the year Jan is Sheet 1,Feb Is Sheet 2 and so on I need the Headings to show on march (Sheet 3 ) if is march if is April (Sheet 4) I need march off and April on Is this Possible Antonyo "Dave Peterson" escribió en el mensaje ... If you name the macro auto_open, it'll run when you open the workbook. Then you can check the date to see if it should continue: Sub auto_open() if format(date,"mmyyyy") = "042005" then ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings else 'do nothing end if End Sub Antonyo wrote: Is there a way to start this macro by it self for the whole mont of april 2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
Hello Again
Can You take a look to this link? This is part of the WorkBook http://www.geocities.com/antonioata/Furniture.xls Regards Antonyo "Dave Peterson" escribió en el mensaje ... They're named ",1", ",2", ..., ",12"???? That looks highly unusual to me. Are they named "sheet 1" (with a space), "sheet1" (no space) or just "1" (no sheet)? Antonyo wrote: Hello Again I have 12 Sheets named - ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 Regards Antonyo "Dave Peterson" escribió en el mensaje ... You have 12 sheets named: Jan, Feb, Mar, ..., Dec? If yes, then how about something like: Option Explicit Sub auto_open() Dim wks As Worksheet Dim CurMonth As String CurMonth = Format(Date, "mmm") For Each wks In ThisWorkbook.Worksheets With wks .Select ActiveWindow.DisplayHeadings _ = CBool((LCase(.Name) = LCase(CurMonth))) End With Next wks End Sub Although I do agree with Tim. The first thing I would do is show those headers. Antonyo wrote: I Have 12 sheets, one for every month of the year Jan is Sheet 1,Feb Is Sheet 2 and so on I need the Headings to show on march (Sheet 3 ) if is march if is April (Sheet 4) I need march off and April on Is this Possible Antonyo "Dave Peterson" escribió en el mensaje ... If you name the macro auto_open, it'll run when you open the workbook. Then you can check the date to see if it should continue: Sub auto_open() if format(date,"mmyyyy") = "042005" then ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings else 'do nothing end if End Sub Antonyo wrote: Is there a way to start this macro by it self for the whole mont of april 2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
I don't open other workbooks.
You may want to explain in plain text. Antonyo wrote: Hello Again Can You take a look to this link? This is part of the WorkBook http://www.geocities.com/antonioata/Furniture.xls Regards Antonyo "Dave Peterson" escribió en el mensaje ... They're named ",1", ",2", ..., ",12"???? That looks highly unusual to me. Are they named "sheet 1" (with a space), "sheet1" (no space) or just "1" (no sheet)? Antonyo wrote: Hello Again I have 12 Sheets named - ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 Regards Antonyo "Dave Peterson" escribió en el mensaje ... You have 12 sheets named: Jan, Feb, Mar, ..., Dec? If yes, then how about something like: Option Explicit Sub auto_open() Dim wks As Worksheet Dim CurMonth As String CurMonth = Format(Date, "mmm") For Each wks In ThisWorkbook.Worksheets With wks .Select ActiveWindow.DisplayHeadings _ = CBool((LCase(.Name) = LCase(CurMonth))) End With Next wks End Sub Although I do agree with Tim. The first thing I would do is show those headers. Antonyo wrote: I Have 12 sheets, one for every month of the year Jan is Sheet 1,Feb Is Sheet 2 and so on I need the Headings to show on march (Sheet 3 ) if is march if is April (Sheet 4) I need march off and April on Is this Possible Antonyo "Dave Peterson" escribió en el mensaje ... If you name the macro auto_open, it'll run when you open the workbook. Then you can check the date to see if it should continue: Sub auto_open() if format(date,"mmyyyy") = "042005" then ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings else 'do nothing end if End Sub Antonyo wrote: Is there a way to start this macro by it self for the whole mont of april 2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub -- Dave Peterson -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
Hello Dave
On the VBAProject shows VBAProject(Furniture.xls) -Microsoft Excel Objects Sheet(1),1 Sheet(2),2 Sheet(3),3 Sheet(4),4 Sheet(5),5 Sheet(6),6 Sheet(7),7 Sheet(8),8 Sheet(9),9 Sheet(10),10 Sheet(11),11 Sheet(12),12 ThisWorkbook I made this workbook on HTML if you like to take a look of it If not is Ok I understand http://www.geocities.com/antonioata/Excel/Furniture.htm Regards Antonyo "Dave Peterson" escribió en el mensaje ... I don't open other workbooks. You may want to explain in plain text. Antonyo wrote: Hello Again Can You take a look to this link? This is part of the WorkBook http://www.geocities.com/antonioata/Furniture.xls Regards Antonyo "Dave Peterson" escribió en el mensaje ... They're named ",1", ",2", ..., ",12"???? That looks highly unusual to me. Are they named "sheet 1" (with a space), "sheet1" (no space) or just "1" (no sheet)? Antonyo wrote: Hello Again I have 12 Sheets named - ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 Regards Antonyo "Dave Peterson" escribió en el mensaje ... You have 12 sheets named: Jan, Feb, Mar, ..., Dec? If yes, then how about something like: Option Explicit Sub auto_open() Dim wks As Worksheet Dim CurMonth As String CurMonth = Format(Date, "mmm") For Each wks In ThisWorkbook.Worksheets With wks .Select ActiveWindow.DisplayHeadings _ = CBool((LCase(.Name) = LCase(CurMonth))) End With Next wks End Sub Although I do agree with Tim. The first thing I would do is show those headers. Antonyo wrote: I Have 12 sheets, one for every month of the year Jan is Sheet 1,Feb Is Sheet 2 and so on I need the Headings to show on march (Sheet 3 ) if is march if is April (Sheet 4) I need march off and April on Is this Possible Antonyo "Dave Peterson" escribió en el mensaje ... If you name the macro auto_open, it'll run when you open the workbook. Then you can check the date to see if it should continue: Sub auto_open() if format(date,"mmyyyy") = "042005" then ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings else 'do nothing end if End Sub Antonyo wrote: Is there a way to start this macro by it self for the whole mont of april 2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub -- Dave Peterson -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date for ToggleHeadings macro
I bet that the codenames (first in that list) didn't really have the ()'s in
them. More like: Sheet1 (1) Sheet2 (2) Sheet3 (3) .... Sheet12 (12) Maybe this one: Option Explicit Sub auto_open() Dim wks As Worksheet Dim CurMonth As String CurMonth = Format(Date, "m") For Each wks In ThisWorkbook.Worksheets With wks .Select ActiveWindow.DisplayHeadings _ = CBool((LCase(.Name) = LCase(CurMonth))) End With Next wks End Sub Antonyo wrote: Hello Dave On the VBAProject shows VBAProject(Furniture.xls) -Microsoft Excel Objects Sheet(1),1 Sheet(2),2 Sheet(3),3 Sheet(4),4 Sheet(5),5 Sheet(6),6 Sheet(7),7 Sheet(8),8 Sheet(9),9 Sheet(10),10 Sheet(11),11 Sheet(12),12 ThisWorkbook I made this workbook on HTML if you like to take a look of it If not is Ok I understand http://www.geocities.com/antonioata/Excel/Furniture.htm Regards Antonyo "Dave Peterson" escribió en el mensaje ... I don't open other workbooks. You may want to explain in plain text. Antonyo wrote: Hello Again Can You take a look to this link? This is part of the WorkBook http://www.geocities.com/antonioata/Furniture.xls Regards Antonyo "Dave Peterson" escribió en el mensaje ... They're named ",1", ",2", ..., ",12"???? That looks highly unusual to me. Are they named "sheet 1" (with a space), "sheet1" (no space) or just "1" (no sheet)? Antonyo wrote: Hello Again I have 12 Sheets named - ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 Regards Antonyo "Dave Peterson" escribió en el mensaje ... You have 12 sheets named: Jan, Feb, Mar, ..., Dec? If yes, then how about something like: Option Explicit Sub auto_open() Dim wks As Worksheet Dim CurMonth As String CurMonth = Format(Date, "mmm") For Each wks In ThisWorkbook.Worksheets With wks .Select ActiveWindow.DisplayHeadings _ = CBool((LCase(.Name) = LCase(CurMonth))) End With Next wks End Sub Although I do agree with Tim. The first thing I would do is show those headers. Antonyo wrote: I Have 12 sheets, one for every month of the year Jan is Sheet 1,Feb Is Sheet 2 and so on I need the Headings to show on march (Sheet 3 ) if is march if is April (Sheet 4) I need march off and April on Is this Possible Antonyo "Dave Peterson" escribió en el mensaje ... If you name the macro auto_open, it'll run when you open the workbook. Then you can check the date to see if it should continue: Sub auto_open() if format(date,"mmyyyy") = "042005" then ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings else 'do nothing end if End Sub Antonyo wrote: Is there a way to start this macro by it self for the whole mont of april 2005? Thanks in advance Sub ToggleHeadings() ActiveWindow.DisplayHeadings = Not _ ActiveWindow.DisplayHeadings End Sub -- Dave Peterson -- Dave Peterson -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Insert Current Date into cell - Macro to "Save As" | Excel Worksheet Functions | |||
Date Macro | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
Date macro | Excel Programming | |||
A macro for the today's date...not the current date | Excel Programming |