LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Loading UserForm Controls (with a twist!)

If the checkbox names correspond EXACTLY to what you put in the cells
(as you describe, CheckBox1 corresponds to "Caption 1"), then you
could do something like this:

1) Split the value of the cell into a Variant:

Dim values() As Variant
values = Split(Range("A1").Value, ";")

2) Loop through the variant and re-populate each control accordingly

Dim i As Long
Dim valueName As String
Dim controlNumber As Long
For i = LBound(values) to UBound(values)
valueName = values(i) ' C

' extract number so we know which control to activate
' i.e. for "Caption 1", controlNumber = 1
controlNumber = Right$(valueName,1)

' re-populate the control
Me.Controls("CheckBox" & controlNumber).Value = -1
Next i

--JP


On Oct 30, 11:21*am, Trevor Williams
wrote:
Hi All,

I have a UserForm that contains a multipage control. *Each page of the
control contains several Frames, and each Frame contains several CheckBoxes.

Once the user has made their selection the Captions of the Checkboxes are
written to a specific Cell on the ActiveSheet, seperated with a semi-colon.

 
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
Loading a Userform Chad Excel Programming 4 August 22nd 07 05:06 PM
Loading a Userform Jason Zischke Excel Programming 2 March 13th 06 08:37 AM
Loading website from userform Danny Boy via OfficeKB.com Excel Programming 0 January 29th 06 04:09 PM
Loading Userform Steven Cheng Excel Programming 3 December 9th 05 07:18 PM
Loading UserForm on start up. Kobus Excel Programming 2 April 1st 05 11:13 AM


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