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

I am trying to use checkboxes that will place one of two values in a cell
based on the checkbox being TRUE/FALSE. The spreadsheet I have created
calculates my baseline annual salary. In doing so, I had to list the
holidays that the county recognizes. If I work that holiday, then I get paid
for 16 hours. Otherwise I get paid for 8 hours. The problem is that the
formula is not picking up the ELSE statement. The value placed in the cell
is 16, regardless of the checkbox being TRUE or FALSE.

The cells involved a
E23:E33 (name of holidays)
G23:G33 (value of hours worked - 8 or 16)
H23:H33 (placement of checkbox)

The formula that I created in the macro is:

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then Worksheets("Pay-Calc").Cells(23, 7).Value
= 16 Else Worksheets("Pay-Calc").Cells(23, 7).Value = 8
End Sub

NOTE: 1) The IF statement is on one line in the macro. 2) The appropriate
adjustments were made to reference the correct CHECKBOX and CELL - ie
CHECKBOX1 - CHECKBOX11 and CELLS(23,7) - CELLS(33,7)

Can anyone help me out with this?

Thanks,
Les
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Checkbox problem


If CheckBox1.Value = True Then
Worksheets("Sheet1").Cells(23, 7).Value = 16
Else: Worksheets("Sheet1").Cells(23, 7).Value = 8
End If


this seems to work for me


--
davesexcel


------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=564091

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
problem with checkbox control Giselle Excel Worksheet Functions 1 March 31st 06 12:57 PM
userform checkbox problem with controlsource Pierre via OfficeKB.com[_2_] Excel Programming 1 October 30th 05 02:32 PM
Checkbox problem Patrick Simonds Excel Programming 1 September 29th 05 08:47 AM
Checkbox problem Patrick Simonds Excel Programming 1 September 29th 05 05:37 AM
Help: weild checkbox problem huangx06 Excel Programming 0 July 7th 05 11:13 PM


All times are GMT +1. The time now is 11:45 AM.

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

About Us

"It's about Microsoft Excel"