+ Reply to Thread
Results 1 to 5 of 5

Button to add 1 to selected cell

  1. #1
    CJ
    Guest

    Button to add 1 to selected cell

    Hi Groupies:

    I would like to create a macro that allows me to add the value of 1 to the
    content of any cell that I select.

    For example:

    If I select a10,b12,c23 and d45, I would like to click on a button and have
    their current content increase by 1.

    I think this needs to be done in VBA code, but I am not sure what to do or
    how to start ...........something like x=x+1.....

    Any ideas or suggestions?

    Thanks



  2. #2
    Don Guillett
    Guest

    Re: Button to add 1 to selected cell

    how about
    for each c in selection
    c.value=c+1
    next

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "CJ" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Groupies:
    >
    > I would like to create a macro that allows me to add the value of 1 to the
    > content of any cell that I select.
    >
    > For example:
    >
    > If I select a10,b12,c23 and d45, I would like to click on a button and
    > have
    > their current content increase by 1.
    >
    > I think this needs to be done in VBA code, but I am not sure what to do or
    > how to start ...........something like x=x+1.....
    >
    > Any ideas or suggestions?
    >
    > Thanks
    >
    >




  3. #3
    CJ
    Guest

    Re: Button to add 1 to selected cell

    Hi Don:

    That is exactly what I wanted. I'm not sure if I went about it properly, I
    pretended to record a macro, stopped recording and then edited to add your
    text.

    Thanks a bunch!

    CJ

    "Don Guillett" wrote:

    > how about
    > for each c in selection
    > c.value=c+1
    > next
    >
    > --
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > "CJ" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi Groupies:
    > >
    > > I would like to create a macro that allows me to add the value of 1 to the
    > > content of any cell that I select.
    > >
    > > For example:
    > >
    > > If I select a10,b12,c23 and d45, I would like to click on a button and
    > > have
    > > their current content increase by 1.
    > >
    > > I think this needs to be done in VBA code, but I am not sure what to do or
    > > how to start ...........something like x=x+1.....
    > >
    > > Any ideas or suggestions?
    > >
    > > Thanks
    > >
    > >

    >
    >
    >


  4. #4
    Don Guillett
    Guest

    Re: Button to add 1 to selected cell

    glad it helped. Perhaps you should post your final for the archives

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "CJ" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Don:
    >
    > That is exactly what I wanted. I'm not sure if I went about it properly, I
    > pretended to record a macro, stopped recording and then edited to add your
    > text.
    >
    > Thanks a bunch!
    >
    > CJ
    >
    > "Don Guillett" wrote:
    >
    >> how about
    >> for each c in selection
    >> c.value=c+1
    >> next
    >>
    >> --
    >> Don Guillett
    >> SalesAid Software
    >> [email protected]
    >> "CJ" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Hi Groupies:
    >> >
    >> > I would like to create a macro that allows me to add the value of 1 to
    >> > the
    >> > content of any cell that I select.
    >> >
    >> > For example:
    >> >
    >> > If I select a10,b12,c23 and d45, I would like to click on a button and
    >> > have
    >> > their current content increase by 1.
    >> >
    >> > I think this needs to be done in VBA code, but I am not sure what to do
    >> > or
    >> > how to start ...........something like x=x+1.....
    >> >
    >> > Any ideas or suggestions?
    >> >
    >> > Thanks
    >> >
    >> >

    >>
    >>
    >>




  5. #5
    CJ
    Guest

    Re: Button to add 1 to selected cell

    Sure, here it is:

    Sub Increase1()
    '
    ' Increase1 Macro
    ' Macro recorded 3/30/2006
    '
    For Each C In Selection
    C.Value = C + 1
    Next
    '
    End Sub

    CJ

    "Don Guillett" wrote:

    > glad it helped. Perhaps you should post your final for the archives
    >
    > --
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > "CJ" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi Don:
    > >
    > > That is exactly what I wanted. I'm not sure if I went about it properly, I
    > > pretended to record a macro, stopped recording and then edited to add your
    > > text.
    > >
    > > Thanks a bunch!
    > >
    > > CJ
    > >
    > > "Don Guillett" wrote:
    > >
    > >> how about
    > >> for each c in selection
    > >> c.value=c+1
    > >> next
    > >>
    > >> --
    > >> Don Guillett
    > >> SalesAid Software
    > >> [email protected]
    > >> "CJ" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > Hi Groupies:
    > >> >
    > >> > I would like to create a macro that allows me to add the value of 1 to
    > >> > the
    > >> > content of any cell that I select.
    > >> >
    > >> > For example:
    > >> >
    > >> > If I select a10,b12,c23 and d45, I would like to click on a button and
    > >> > have
    > >> > their current content increase by 1.
    > >> >
    > >> > I think this needs to be done in VBA code, but I am not sure what to do
    > >> > or
    > >> > how to start ...........something like x=x+1.....
    > >> >
    > >> > Any ideas or suggestions?
    > >> >
    > >> > Thanks
    > >> >
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >


+ 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