+ Reply to Thread
Results 1 to 10 of 10

Change numbers

  1. #1
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Change numbers

    Hello all,

    Hope someone can help with this.

    I have numbers in 5 columns B2 to F11 anything from 1 to 20.
    What i am trying to do is when the button is pressed the numbers change.
    ei- if B2 = 12 when i press button B2 either changes randomly to 11-13 or stays at 12.
    if b2 was 10 then it changes to 9-11 or stays at 10.
    The numbers in the other cells will be the same as B2.

    Any help will be great.Thanks
    Attached Files Attached Files
    Last edited by mdshotgun; 02-03-2011 at 07:21 AM.

  2. #2
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Change numbers

    in the cells with the numbers i entered =randbetween(1,19) > i then recorded a macro and added a button and associated the two.

    Hope this helps with your lotto predictions! if you win remember me!!

    dont forget, if this has helped please mark as solved!
    Attached Files Attached Files
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  3. #3
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Change numbers

    Thanks Blake 7 for the reply.

    Yes i like your lotto predictions,but unfortunately it's not a lotto prediction we are doing.

    The number in a cell can only go down/up by 1 or stay unchanged with each button click.

    But thanks for trying anyway.

  4. #4
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Change numbers

    hiya - sorry i misread your post. Can you clarify what u mean by

    "The numbers in the other cells will be the same as B2"

    from you original post. I dont get this bit.

    Cheers

  5. #5
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Change numbers

    I was using cell B2 as an example.
    and if you can get something working with example "B2"
    then all the other numbers will do the same that is
    ei-if i press button and B2 goes from 12 to 13 then B3 etc will either go up/down or stay the same just like B2.
    Does this make it some bit clearer.Hopefully it does.

  6. #6
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Change numbers

    Can anyone help with a solution for this problem.
    Any help is very welcomed.

  7. #7
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,255

    Re: Change numbers

    If one cell (say B2) increases by 1 in value, should all of the other cells also increase by 1 in value, or is the change in each cell independent of the others?
    Hope that helps,

    Colin

    RAD Excel Blog

  8. #8
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Change numbers

    Thanks for replying.
    The change in each cell should be independent of the others.

    If for ex we take B2:F2.
    B2=12 C2=8 D2=4 E2=9 F2=15

    When the change numbers button is pressed.

    B2 can go from 12 to 11 or 13 or stay at 12
    C2 can go from 8 to 7 or 9 or stay at 8 etc.

    If the button is pressed again and B2 went to 13 from prevoius button press
    Then it now can go from 13 to 14 or back to 12 or just stay at 13 etc.

    Thanks for replying and i hope you can help further.Thanks

  9. #9
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,255

    Re: Change numbers

    Hi,

    So something like this:

    Please Login or Register  to view this content.
    I'll let you have a go at revising the code should you need to introduce a cap/floor (20/1) to the cell value.

  10. #10
    Forum Contributor
    Join Date
    05-16-2010
    Location
    glasgow scothland
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Change numbers

    Hi Colin,

    That is amazing,works a treat.

    Thank you very much.I am totally gratefull.

+ 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