W
WLMPilot
I have a workbook for balancing my checkbook.
Given:
1) Worksheets Named: 2004, 2005, 2006, 2007, 2008, 2009, STATS
2) Each year worksheet as the year, ie 2009, in cell A1
3) The STATS worksheet has a section for each year that summarizes that data
from its respective year. Each section has the year in column A.
I have a command button on each year worksheet, ie 2009, with caption of
STATS. Obviously I want to jump over to STATS worksheet when this button is
clicked.
Here's the trick: I want to be able to jump to the respective year STATS
information. EXAMPLE: If I am in year 2008 and click the STATS button, I
want to go directly to the 2008 section on the STATS worksheet. I know that
the macro will need to look at cell A1 on the 2008 worksheet and then find
2008 in column A on the STATS worksheet. and then select or activate. I just
don't know how to do it.
Below is the current macro for the STATS button:
Private Sub CommandButton16_Click() 'STATS button
Dim buttoncaption As String
buttoncaption = CommandButton16.Caption 'Caption = STATS
Application.Goto Reference:=Worksheets(buttoncaption).Range("A1")
End Sub
Thanks in advance.
Given:
1) Worksheets Named: 2004, 2005, 2006, 2007, 2008, 2009, STATS
2) Each year worksheet as the year, ie 2009, in cell A1
3) The STATS worksheet has a section for each year that summarizes that data
from its respective year. Each section has the year in column A.
I have a command button on each year worksheet, ie 2009, with caption of
STATS. Obviously I want to jump over to STATS worksheet when this button is
clicked.
Here's the trick: I want to be able to jump to the respective year STATS
information. EXAMPLE: If I am in year 2008 and click the STATS button, I
want to go directly to the 2008 section on the STATS worksheet. I know that
the macro will need to look at cell A1 on the 2008 worksheet and then find
2008 in column A on the STATS worksheet. and then select or activate. I just
don't know how to do it.
Below is the current macro for the STATS button:
Private Sub CommandButton16_Click() 'STATS button
Dim buttoncaption As String
buttoncaption = CommandButton16.Caption 'Caption = STATS
Application.Goto Reference:=Worksheets(buttoncaption).Range("A1")
End Sub
Thanks in advance.