+ Reply to Thread
Results 1 to 3 of 3

Help creating buttons for cells

Hybrid View

masonsushi Help creating buttons for... 05-01-2012, 03:57 PM
111StepsAhead Re: Help creating buttons for... 05-01-2012, 04:59 PM
masonsushi Re: Help creating buttons for... 05-03-2012, 09:28 AM
  1. #1
    Registered User
    Join Date
    05-01-2012
    Location
    Columbia,SC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help creating buttons for cells

    Hi guys, I have been reading and found this awesome site. I have a problem. I have a column of items where each cell in the column is the quantity on hand. I wanted to see if there is a way to have 2 small buttons per cell ( + & -) so i can just click it to adjust the quantity up or down in each cell so i don't have to retype the number for each one.

    I am fairly new with Excel, with the most basic of skills in it.

    Thanks in advance.

    Mason

  2. #2
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: Help creating buttons for cells

    Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Target.Column = 2 Then
            If Range("A" & Target.Row).Value <> "" Then
                Range("A" & Target.Row).Value = Range("A" & Target.Row).Value + 1
            End If
        ElseIf Target.Column = 3 Then
            If Range("A" & Target.Row).Value <> "" Then
                Range("A" & Target.Row).Value = Range("A" & Target.Row).Value - 1
            End If
        End If
        Cancel = True
    End Sub
    Put the above code in the worksheet you want it to work on. It assumes in column A you have some number. If you double click column B, the number in A goes up by 1. If you double click column C, the number in A goes down by 1. At least, this will give you a good start on what you want.

  3. #3
    Registered User
    Join Date
    05-01-2012
    Location
    Columbia,SC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help creating buttons for cells

    I still cant seem to get your method to work 111stepsAhead. I tried interring in and it came up with an error message.

+ 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