Results 1 to 4 of 4

Spin button suddenly stopped working

Threaded View

  1. #3
    Forum Contributor
    Join Date
    08-29-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    103

    Re: Spin button suddenly stopped working

    No fluff code version with explanations:

    Private Sub btnViewVendor_Click()
                        
        Dim ventu As Range, rven As Long
        Set ventu = Worksheets("Vendors").Range("VendorList")
        rven = ventu.Rows.Count
        
        With ventu
            Set ventu = ventu.Resize(rven, 1).Offset(1, 0): ventu.Name = "Vendor"
        End With
    
        '####NONE OF THAT CODE ABOVE SHOULD HAVE ANY BEARING ON THE CODE BELOW
        '####I CAN JUST AS EASILY MAKE RVEN = Worksheets("Vendors").Range("VendorList").Rows.Count AND STILL GET THE VALUE OF 29.
        '####VENDORLIST IS A NAMED RANGE ON THE SHEET VENDOR.
                        
        SpinButton1.Value = rven '####ERROR HERE####
    
        '####THIS CODE BELOW IS IRRELEVANT TO THE PROBLEM. I CAN COMMENT IT OUT AND WILL STILL GET THE ERROR
        ListBox1.ListIndex = SpinButton1.Value - 1
        txtVendorName.Value = ListBox1.Value
    End Sub




    EDIT: Ahh, the little things... I had set a listbox1.listindex to spinbutton1.value on form initialize, so when the value of the spinner was over the listbox it was tied to, the listbox was actually causing the error to the spinner which was causing the error in that section of the code. Looks like problem solved.
    Last edited by Taemex; 12-19-2014 at 07:52 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Vlookup function suddenly stopped working!!!!!
    By danmack in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2013, 10:39 AM
  2. Replies: 3
    Last Post: 05-03-2013, 02:05 PM
  3. [SOLVED] Trace Depenents suddenly stopped working for some cells.
    By hlep in forum Excel General
    Replies: 1
    Last Post: 03-27-2012, 11:28 PM
  4. Code suddenly stopped working
    By bibleguy125 in forum Excel General
    Replies: 1
    Last Post: 02-15-2012, 01:00 PM
  5. Beforeclose sub suddenly stopped working
    By cuewoz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2010, 12:29 PM

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