Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Assigning Macro to "Buttons"

Attached is the sheet I'm working on. The 4 buttons above each of the
years and the sum need a specific macro that when you click on th
button, for example Yr1, it will take you to the other colums whic
contain the more detailed 12 months of that year.
When it takes you to those 12 months the only thing thing I would lik
to be seen is those 12 months (along with that year's summary which i
next to the last month of that year) on the screen. So that if someon
wants to print anything all they they would have printed is only what'
on the screen.
For the last button which is the 3yr Sum I just want it to show th
original yr1, yr2, yr3 and 3yr sum colums when clicked on.(again onl
those 4 colums I would like to show in the screen for viewing an
printing purposes) Thanks, I appreciate it.

BTW....... all of the detailed months colums will be hidden the onl
colums that will be unhidden are the 4 colums with the buttons abov
them

Attachment filename: buttons.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=57129
--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Assigning Macro to "Buttons"

Here is 4 macros, just assign to the buttons


Sub yr1Macro()
Columns("H:T").Hidden = False
Columns("U:AG").Hidden = True
Columns("AH:AT").Hidden = True
End Sub


Sub yr2Macro()
Columns("H:T").Hidden = True
Columns("U:AG").Hidden = False
Columns("AH:AT").Hidden = True
End Sub


Sub yr3Macro()
Columns("H:T").Hidden = True
Columns("U:AG").Hidden = True
Columns("AH:AT").Hidden = False
End Sub


Sub yr3SummaryMacro()
Columns("H:T").Hidden = True
Columns("U:AG").Hidden = True
Columns("AH:AT").Hidden = True
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"grin2000 " wrote in message
...
Attached is the sheet I'm working on. The 4 buttons above each of the 3
years and the sum need a specific macro that when you click on the
button, for example Yr1, it will take you to the other colums which
contain the more detailed 12 months of that year.
When it takes you to those 12 months the only thing thing I would like
to be seen is those 12 months (along with that year's summary which is
next to the last month of that year) on the screen. So that if someone
wants to print anything all they they would have printed is only what's
on the screen.
For the last button which is the 3yr Sum I just want it to show the
original yr1, yr2, yr3 and 3yr sum colums when clicked on.(again only
those 4 colums I would like to show in the screen for viewing and
printing purposes) Thanks, I appreciate it.

BTW....... all of the detailed months colums will be hidden the only
colums that will be unhidden are the 4 colums with the buttons above
them.

Attachment filename: buttons.xls
Download attachment:

http://www.excelforum.com/attachment.php?postid=571293
---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 Need macro to auto set option buttons all to "Yes" or "No" Paula Excel Worksheet Functions 1 October 20th 09 08:07 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" ldiaz Excel Discussion (Misc queries) 2 March 15th 08 07:26 PM
Shortcut key for "Paste Options" and "Error Checking" buttons? johndog Excel Discussion (Misc queries) 1 October 6th 06 11:56 AM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM


All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"