+ Reply to Thread
Results 1 to 4 of 4

Setting spin control max value as a variable - I get an Error 424

Hybrid View

  1. #1
    Registered User
    Join Date
    04-28-2013
    Location
    Salt Lake City, Utah, USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Setting spin control max value as a variable - I get an Error 424

    I am trying to set the max value of an ActiveX spin control button. Here is the code I am trying, for which I get a Runtime error 424 object required:

    Private Sub Spinbutton21_Change()

    Range("H20").Value = SpinButton1.Value ' the spin button controls the value in cell H20
    SpinButton1.Max = ActiveSheet.Range("Y19").Value ' the spin control max value is in cell Y19
    SpinButton1.Min = 0 ' spin control min is 0
    SpinButton1.SmallChange = 1 ' spin control increment is 1

    End Sub

    When I click on Debug, the "Range" line is highlighted. When I click on the properties for the spin control, none of the above settings have the correct value.
    Thanks.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,567

    Re: Setting spin control max value as a variable - I get an Error 424

    Do you have two Spin Buttons?

    Private Sub Spinbutton21_Change()
    
    Range("H20").Value = SpinButton1.Value ' the spin button controls the value in cell H20

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    04-28-2013
    Location
    Salt Lake City, Utah, USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Setting spin control max value as a variable - I get an Error 424

    I figured the error out.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,567

    Re: Setting spin control max value as a variable - I get an Error 424

    I figured the error out
    So, for the benefit of others, what was the problem?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Setting variable to a folder error
    By siobeh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2014, 05:56 AM
  2. compile error: For control variable already in use
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-24-2012, 01:12 PM
  3. [SOLVED] Spin Control does not work on my mac
    By thmehr in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 08-10-2012, 08:52 PM
  4. [SOLVED] Spin Button to control the current row
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2012, 04:09 PM
  5. setting error handling on control creation and deletion
    By joe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-22-2006, 10:40 AM

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