Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA Userform Question (Excel 97)

    Hello All,

    Appreciate the forum, I've learned a lot from it. I was hoping the

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Userform Question (Excel 97)

    This syntax gets the value of the spinbutton named "Spinbutton1":

    (code attached to the spinbutton itself):

    Private Sub SpinButton1_Change()
    MsgBox Me.Controls("SpinButton1").Value
    End Sub
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Userform Question (Excel 97)

    I think that what you want is:

    <pre> Me.Controls(BillName & "SpinButton").Value
    </pre>

    Legare Coleman

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: VBA Userform Question (Excel 97)

    As controls represent the defaul item of UserForms the following should work :

    ActiveCell.Offset(0, 2).Range("A1").Value = Me(BillName & "SpinButton").Value

    Andrew C

  5. #5
    New Lounger
    Join Date
    Feb 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Userform Question (Excel 97)

    Thanks Legare and Andrew your solutions did the trick. I had to tweak it a little bit. I forgot to mention I update the spreadsheet from the module once the user clicks update.

    Apprecaite the help!

Posting Permissions

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