Consulting

Results 1 to 7 of 7

Thread: how to create a excel macro (button) that will show next number from a list?

  1. #1
    VBAX Newbie
    Joined
    Dec 2017
    Posts
    3
    Location

    how to create a excel macro (button) that will show next number from a list?

    Hi all,

    I'm trying to create macro for my job, but I'm not sure how to do this. I googled through many topics on this forum and YT videos, but I'm still not sure how to achieve this.

    What I need to do?

    Problem 1:

    I have one sheet in excel called "sheet2" with list of numbers from 1 to 60. This list is random so not 1,2,3,4,5 but 1,16,52 etc. I need to create a macro button that will draw the next number from this list and populate it to a different sheet in the same excel file (sheet1, field B8). The button will be located in sheet2 and the numbers are situated in fields B2 to B61.

    Problem 2:

    I need to enable this macro only for certain people, so I have to protect it with a password or what would be the best protect it and hide the whole sheet from other people who can see only sheet 1. Is there any way to block the macro button so that only certain users may be able to use it? Is there any way to also show who and when pressed this button?

    Problem 3:

    This is the biggest problem. This will be a read only file used by many people so it won’t save. Is there any way to make excel remember which number from problem 1 was drawn, despite the copy did not save when previous user closed original excel?
    I already created a macro that saves a copy of excel file with the data that someone created in sheet 1. However I doubt that it’s possible that it’s possible to create a macro to save such information for many newly created copies (to remember which number was lastly used on all of those).

    Thank you very much in advance for any help.

    Rado

  2. #2
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    cross posted:
    https://www.mrexcel.com/forum/excel-...ease-help.html

    Please obey the rules about cross posting

  3. #3
    VBAX Newbie
    Joined
    Dec 2017
    Posts
    3
    Location
    Hi Offhelp:

    I also posted this on two other forums, but I still didn't manage to create a macro that would help me fix my issue. I tried to google for few days to find a solution to this issue, and tried to finish this macro on my own, but with no success. Therefore i decided to ask for help on few forums.

    Sorry if I broke any rules, however I'm unable to post links here so I can't provide the links to my other posts (it's possible from 5 messages).


    Could you please help me with my problem?

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    It is still possible to indicate what other forums this issue has been posted into.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  5. #5
    Just for info the link to the other cross-post mentioned is to Excel Forum. Put as a text string below as I can't post a link.

    excelforum.com/excel-programming-vba-macros/1213759-how-to-create-a-excel-macro-button-that-will-show-next-number-from-a-list.html#post4812221
    Using Excel 2010
    (Normally need to save as 97-2003 for other users at work)

  6. #6
    VBAX Newbie
    Joined
    Dec 2017
    Posts
    3
    Location
    Yes - problem solved, sorry for the confusion and cross posting. I'll make sure not do this again

  7. #7
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    @Rado88 -- you can mark this as [Solved] using [Thread Tools] above your first post
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •