+ Reply to Thread
Results 1 to 3 of 3

Spin button function

Hybrid View

  1. #1
    Registered User
    Join Date
    03-02-2007
    Posts
    28

    Lightbulb Spin button function

    DSL PM'd about not wrapping VBA code

    I programmed a spin button it works fine to about 2/3 of the data records then it stops.

    Here is the code I used:

    Dim Wks As Worksheet

    Set Wks = ThisWorkbook.Worksheets(1)
    With UserForms(0)
    r = .SpinButton1.Value + 1
    .TextBox1 = Wks.Cells(r, "A").Value
    .TextBox2 = Wks.Cells(r, "B").Value
    .TextBox3 = Wks.Cells(r, "C").Value
    .TextBox4 = Wks.Cells(r, "D").Value
    .TextBox5 = Wks.Cells(r, "E").Value
    .TextBox6 = Wks.Cells(r, "F").Value
    .TextBox7 = Wks.Cells(r, "G").Value
    .TextBox8 = Wks.Cells(r, "H").Value
    .TextBox9 = Wks.Cells(r, "I").Value
    .TextBox10 = Wks.Cells(r, "J").Value
    .TextBox11 = Wks.Cells(r, "K").Value
    .TextBox12 = Wks.Cells(r, "L").Value
    .TextBox13 = Range("J1001").Value
    .TextBox14 = Range("I1001").Value
    End With

    Pretty straight forward but it will not move to the bottom of the data record list. Since the list is ever expanding did I miss something?
    Last edited by mudraker; 04-05-2007 at 07:14 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello DSJ,

    The SpinButton has 2 properties that control the counting limits, .Min and .Max. As your list expands you will need to set Spinbutton1.Max = to the new limit. The .Min value is set to zero by default, and .Max to 100.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    03-02-2007
    Posts
    28

    Spin Button

    Leith, Thanks works great!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1