+ Reply to Thread
Results 1 to 5 of 5

VBA Save Button- Verify 2 cells on two worksheets match before saving

  1. #1
    Registered User
    Join Date
    12-16-2019
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 365
    Posts
    9

    VBA Save Button- Verify 2 cells on two worksheets match before saving

    I have a workbook with various worksheets that get saved in different combinations. I have a series of buttons that are clicked to save those different combinations. I need to add a step that prevents the save from happening if certain cells across the worksheets don't match.

    Here is one example button:



    Please Login or Register  to view this content.
    I need to make sure the following cells match before the save occurs:
    Sheet 44 (Canine Wellness) "C3"
    Sheet 30 (VitD New) - "D3"
    Sheet 39 (Canine B12) "D3"

    If they match, save as written above, if not, no save with error message "IDs Don't Match"

    Thank you!
    Last edited by bfmhoops16; 12-16-2019 at 06:11 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA Save Button- Verify 2 cells on two worksheets match before saving

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    12-16-2019
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 365
    Posts
    9

    Re: VBA Save Button- Verify 2 cells on two worksheets match before saving

    Thank you- just got rushing a bit fast, but think I have it corrected!

  4. #4
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: VBA Save Button- Verify 2 cells on two worksheets match before saving

    Hi,


    Please Login or Register  to view this content.
    I am guessing this is what you mean ?
    Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
    If you have been helped, maybe you could click the *

  5. #5
    Registered User
    Join Date
    12-16-2019
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 365
    Posts
    9

    Re: VBA Save Button- Verify 2 cells on two worksheets match before saving

    That was helpful and works for what I needed, however I was still looking to have a message popup if those conditions aren't met: "IDs Do Not Match". Otherwise it may not be clear that the file did not save.

+ 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. How to save macro when code is prevent saving if there's blank cells ?
    By gilver in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2016, 06:20 AM
  2. Replies: 1
    Last Post: 01-30-2016, 08:35 AM
  3. Replies: 6
    Last Post: 12-02-2015, 03:32 PM
  4. [SOLVED] Saving range of cells in a PDF format using a button on excel worksheet
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-13-2013, 12:18 PM
  5. [SOLVED] How do I save Excel info without saving the reference cells?
    By Dave in forum Excel General
    Replies: 2
    Last Post: 07-10-2006, 03:29 AM
  6. [SOLVED] I need to verify data from 2 different worksheets how do i do it
    By data verification in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2005, 03:05 PM
  7. I want to verify data in 2 different worksheets
    By data verification in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2005, 01:05 PM

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