Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Looking for a shortcut

I have a worksheet that contains information about pay, holidays working/not
working, etc., for each year, starting with 2006. Each year is four columns
wide.

Regarding the holiday section of each year, I list the holidays as follows
and have a checkbox that will be TRUE (checked) if working that holiday.

<---------------------2009-------------------------
P Q R S <---columns
Holiday | hrs pd | ckbox | date of holiday |
Holiday | hrs pd | ckbox | date of holiday |
Holiday | hrs pd | ckbox | date of holiday |

Based on the value of each checkbox, a macro will place a value of 8 hrs or
16 hrs in the "hrs pd" (column Q). Below is a macro used for one of the
holidays for 2008:

Private Sub CheckBox23_Click()
If CheckBox23.Value = True Then
Worksheets("Pay-Calc").Cells(10, 12).Value = 16
Else: Worksheets("Pay-Calc").Cells(10, 12).Value = 8
End If
End Sub

As each year approaches, I copy/paste and setup that year, adding 11 more
checkboxes and their individual macro.

Referencing above macro, the holidays are listed on rows 10-20 inclusive.
The column value of the .Cells(10, 12) increases by 5 each year, ie 2006 was
2, 2007 was 7, 2008 was 12, and 2009 is 17.

I am wondering if there is a way to combine everything into one macro per
year that will look at the checkboxes for that year instead of having 11
individual macros as shown above?

Thanks for your help!

Les
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
shortcut has change or move so this shortcut can not open bakerstreet Excel Worksheet Functions 2 April 2nd 10 01:21 PM
Macro Shortcut Key Conflicts with Application Shortcut Keys Jordan Hotzel Excel Programming 0 October 13th 06 06:39 AM
Macro Shortcut Key Conflicts with Application Shortcut Keys Jordan Hotzel Excel Programming 0 October 13th 06 06:39 AM
Shortcut Graham Excel Discussion (Misc queries) 1 January 3rd 06 05:45 PM
Is there a shortcut? Bryan Excel Discussion (Misc queries) 2 December 15th 05 12:25 PM


All times are GMT +1. The time now is 02:23 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"