LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default help in checkbox code

Hi All,

I have the following code.

Private Sub CommandButton1_Click()
MyStr = ""
For Each ctl In BranchSelect.Controls

If TypeOf ctl Is MSForms.CheckBox Then
If ctl.Value = True Then
MyStr = MyStr & Left(ctl.Caption, 3) & ","
End If
End If
Next
MyStr = "{" & MyStr & "0}"
LblOffc.Caption = MyStr
End Sub


the first three charecters of my checkbox captions are like
100,101,102,103,104 etc

what i am looking for is to get LblOffc.Caption like {101,102,104} if i
have checked checkboxes with 101,102,103 as their caption (first 3
digits)

in my above code i have an extra 0 and an extra coma (,) which i want
to remove. also in case all items de selected caption shud be empty
("") now i am having {0} there..

any help..

thanks

 
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
Simple Checkbox Message Code nemadrias Excel Discussion (Misc queries) 10 June 21st 06 08:59 PM
2pcs of code, a button & a checkbox Lynda Excel Programming 4 February 12th 05 07:58 PM
A VBA code that clicks a checkbox nevaspb Excel Programming 2 August 19th 04 03:55 AM
How to Check a checkbox on spreadsheet from VB code Harinath Excel Programming 2 April 8th 04 09:51 AM
Checkbox Code Edwin Tam[_2_] Excel Programming 0 January 14th 04 02:26 AM


All times are GMT +1. The time now is 01:49 PM.

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"