+ Reply to Thread
Results 1 to 7 of 7

incrementing integers!

Hybrid View

  1. #1
    Registered User
    Join Date
    09-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    41

    incrementing integers!

    For instance if I clicked a button, it will generate a number starting from 60, How do I make it in a way that when I clicked the button again, it will increment by 1 using VBA?

    Thanks in advance!
    Dinosaur1993

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: incrementing integers!

    try
    Sub test()
    If Range("a1").Value < 60 Then
    Range("a1").Value = 60
    Else
    Range("a1").Value = Range("a1").Value + 1
    End If
    
    End Sub
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    09-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: incrementing integers!

    In this one we had a restriction, how do we work it out if we dont have a restricted value? cheers

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: incrementing integers!

    i have no idea what you mean

  5. #5
    Registered User
    Join Date
    09-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: incrementing integers!

    sorry for being vague.
    Its like say for instance, initially, we know that we are counting to 60 yeah?

    What if, we just keep on incrementing to infinity without knowing the end value?

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: incrementing integers!

    thats not even the same question in your first post you say you want to start at 60 not finish at 60

  7. #7
    Registered User
    Join Date
    09-21-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: incrementing integers!

    oh wait, sorry my bad!!! I was thinking of another question

+ 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. A list of Consecutive Integers, can I search for missing integers
    By Harlan Grove in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 09-06-2005, 08:05 PM
  2. [SOLVED] A list of Consecutive Integers, can I search for missing integers
    By CM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 PM
  3. [SOLVED] A list of Consecutive Integers, can I search for missing integers
    By CM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  4. A list of Consecutive Integers, can I search for missing integers
    By CM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. A list of Consecutive Integers, can I search for missing integers
    By CM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 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