Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default List box - how to uncheck box

Hello,

I have the following code to accompany a listbox.

My problem is that once a box is checked, it stays checked until I check
another box. I cannot check the same box a second time and have the
associated procedure run. I have to check another box to come back to
the original.

Does anybody know a way around this.

Thanks much,
Anita


Private Sub ListBox1_Click()
If ListBox1.Value = "depreciation" Then
MsgBox "You have chosen to update depreciation"
' Depreciation
ElseIf ListBox1.Value = "salaries" Then
MsgBox "You have chosen to update salaries"

ElseIf ListBox1.Value = "benefit %" Then
MsgBox "you have chosen to update the benefit %, continue?"

ElseIf ListBox1.Value = "payroll tax %" Then
MsgBox "you have chosen to update the payroll tax %, continue?"

ElseIf ListBox1.Value = "Vacation Accrual" Then
MsgBox "You have chosen to update Vacation Accrual"

ElseIf ListBox1.Value = "depreciation and vacation accrual" Then
MsgBox "You have chosen to update depreciation and vacation accrual"
ElseIf ListBox1.Value = "benefit % and payroll tax %" Then
MsgBox "You have chosen to update the benefit and payroll tax %'s"

End If

End Sub

A

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default List box - how to uncheck box

im not sure about this but it might be something to do with setting th
focus like this

ListBox1.Value = ""
Listbox1.Setfocus

Dont take my word for it though as ive only been at this for about
weeks myself.

hope its useful,

Simo

--
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
check and uncheck macro [email protected] Excel Worksheet Functions 6 April 5th 23 01:19 PM
check and uncheck macro [email protected] Excel Discussion (Misc queries) 3 December 31st 08 12:50 AM
Uncheck a box Pietro Excel Discussion (Misc queries) 4 August 29th 07 11:48 AM
Uncheck check boxes Brisbane Rob Excel Discussion (Misc queries) 3 February 15th 06 07:08 PM
Check / Uncheck Box Navy Chief Setting up and Configuration of Excel 1 October 3rd 05 01:54 AM


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