Results 1 to 4 of 4

Help with spin button

Threaded View

  1. #1
    Registered User
    Join Date
    09-25-2013
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    10

    Help with spin button

    Hey again, I was wondering if anyone could help with a spin button programming.
    I am looking to change 2 fields on an excel sheet - C21 and C22- with a spiin button(up and down)
    I did some research and found the code below which works but when i click anywhere on the screen i can change the value, i am looking to have 1 spin button change C21 when i am clicked on it and when I click on C22 i can change the number of it(up or down)
    the code below works, but i can click anybox on the excel sheet and change the number which is not acceptable. Does anyone know how to do this.

    any help is appreciated.

    -------------------------------------
    Private Sub SpinButton1_SpinUp()
        With Selection(1)
            If VarType(.Value) = vbDouble Or _
               VarType(.Value) = vbEmpty Then
                .Value = .Value + 1
                AppActivate "Microsoft Excel"
            End If
        End With
    End Sub
    
    Private Sub SpinButton1_SpinDown()
        With Selection(1)
            If VarType(.Value) = vbDouble Or _
               VarType(.Value) = vbEmpty Then
                .Value = .Value - 1
                AppActivate "Microsoft Excel"
            End If
        End With
    End Sub
    --------------------------------------------------------------
    Last edited by miko.sims; 10-08-2013 at 08:42 PM. Reason: needed #

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Spin Button
    By wetfish in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-20-2013, 01:27 PM
  2. Replies: 2
    Last Post: 03-12-2008, 06:52 PM
  3. Spin Button:spin cells A7
    By ice in forum Excel General
    Replies: 1
    Last Post: 03-16-2007, 02:23 PM
  4. [SOLVED] Spin Button
    By koenigma@hotmail.com in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-12-2005, 03:05 PM
  5. spin button value
    By tina in forum Excel General
    Replies: 2
    Last Post: 03-17-2005, 11:06 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