+ Reply to Thread
Results 1 to 3 of 3

Macro to do various steps

  1. #1
    Registered User
    Join Date
    05-26-2021
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2

    Macro to do various steps

    Hi,

    I'm a bit of a novice with VBA so hoping somebody can help.

    I have created a desk booking system in Excel and want a couple of macro buttons to do the following:

    BOOKING MACRO

    Checks if all 3 fields have been entered (desk reference, date and name)
    NO - alert message
    YES - checks if the booking reference (which is the desk reference and date separated by a hyphen, e.g. D01-260521) is already within column A on a separate tab
    YES - alert message and clears the desk reference and date fields
    NO - records the booking reference and person's name in columns A and B on the separate sheet and alert confirming desk booked which also contains the booking reference

    DESK CANCELLATION

    /Person records the desk booking reference within a cell/

    Macro removes the booking reference from column A on the separate tab (plus the person's name in column B if possible)

    Cheers

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to do various steps

    Hi and welcome to the forum.

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    05-26-2021
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Macro to do various steps

    I've uploaded a slimmed down version of what I have created and tried to explain in more detail below what I'm
    hoping a couple of macros can do.

    1. Person selects date they want to book a desk using the dropdown list to check if it's available.
    A person's name in a cell means it's already booked - the desk reference visible (D01, D02, etc) means it's available.

    2. Person scrolls down to book their desk by recording the desk reference number (cell Z44), the required date (cell Z48) and
    their name (cell Z52) in the relevant fields. When the person records this information, a desk booking reference will
    be generated in cell Z127.

    3. When the BOOK button is clicked, a macro will:

    a) check if any of the cells Z44, Z48 or Z52 are empty:

    if YES message box "Please record all required fields"

    if NO - then check if the booking reference in cell Z127 already exists in column A on the BOOKINGS tab:

    if YES message box "Unfortunately, the desk you require is already booked for that date. Please choose a
    different date or desk" and cells Z44 and Z48 will clear.

    if NO - values in cells Z52 and Z59 will populate the next available row in columns A and B on the BOOKINGS tab and
    a message box saying "Your booking reference is D01-260521. Please keep a note of this as you will need it should you
    wish to cancel your booking"


    When somebody wants to cancel their booking they record the booking reference (e.g. D01-260521) in cell BZ48 and click
    the CANCEL button. This will find and delete the booking reference in column A and the corresponding name in column B.
    Last edited by Simon J; 05-27-2021 at 05:40 PM.

+ 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. Macro only properly doing one of two steps
    By Susie123 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-19-2021, 08:42 AM
  2. Macro only properly doing one of two steps
    By Susie123 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-19-2021, 08:00 AM
  3. Need vba code for a macro to run in 3 steps.
    By BrookeAas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2016, 04:31 PM
  4. Bigger macro cut down into steps.
    By rdelosh74 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2014, 11:51 AM
  5. Office 2010 macro error - Not all steps recreated in macro - Help!
    By duffer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-21-2011, 01:33 PM
  6. Macro that steps, but won't run!
    By qdog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2007, 12:20 PM
  7. [SOLVED] Don't show the steps in a macro
    By LSkarbek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2006, 06:55 PM

Tags for this Thread

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