Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    checkbox, and textbox (Excel 2000)

    Hi all,

    I need some help with the a userform,

    I have three checkboxes that have a string value, when true, and I have two textboxs that I want to add to the activecell.

    Sub
    dim Strvalue as string
    Strvalue=""

    if checkbox1.value = true then
    Strvalue = Strvalue & ", A"
    end if

    if checkbox2.value = true then
    Strvalue = Strvalue & ", B"
    end if

    if checkbox3.value = true then
    Strvalue = Strvalue & ", C"
    end if

    If not (Strvalue='''') then
    Strvalue=Mid(strvalue,2)

    Activecell=strvalue.

    End sub

    What I can't figure out is how do I take the information from the Textboxes and input that as into the activecell along with Strvalue.

    Thanks, Darryl.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: checkbox, and textbox (Excel 2000)

    It's not clear to me from your description where the text boxes come into this. Do you want to concatenate their value to strValue regardless of the setting of the check boxes? If so, you could use something like this:

    If Not (strValue='''') Then
    strValue=Mid(strvalue,2)
    End If

    strValue = Me.textBox1 & " " & Me.TextBox2 & strValue

    ActiveCell = strValue

    or a variation thereof. If that is not what you mean, please explain.

  3. #3
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: checkbox, and textbox (Excel 2000)

    Thank you once again Hans

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •