+ Reply to Thread
Results 1 to 7 of 7

Yes or no confimation before macro runs.

  1. #1
    Registered User
    Join Date
    02-03-2020
    Location
    York
    MS-Off Ver
    2019
    Posts
    27

    Yes or no confimation before macro runs.

    I have this formula (Kindly edited by Logit).

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 10 Then
    If Target.Value = "Invoice Complete" Then
    'Turn off events to prevent recursive calls
    Application.EnableEvents = False
    'Copy row to new worksheet
    Target.EntireRow.Copy
    With Worksheets("Complete")
    .Range("A" & .Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteAll
    End With
    'Delete the source row
    Target.EntireRow.Delete
    'Turn events back on
    Application.EnableEvents = True
    End If
    End If
    End Sub

    however i need the spreadsheet to prompt the user to confirm with a yes or no box before it runs. because if the user changes the cell by accident the macro will run said script meaning potential mistakes.

    i have attached the spreadsheet to show what the spreadsheet will do - if you change the J column cells to Invoice complete it will run the script
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Yes or no confimation before macro runs.

    .
    You can use this example as a template. Change the wording to fit ...

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-03-2020
    Location
    York
    MS-Off Ver
    2019
    Posts
    27

    Re: Yes or no confimation before macro runs.

    Hi Logit,

    I cannot seem to get this to work with my original code.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Yes or no confimation before macro runs.

    .
    Try this version :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-03-2020
    Location
    York
    MS-Off Ver
    2019
    Posts
    27

    Re: Yes or no confimation before macro runs.

    Again thank you.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Yes or no confimation before macro runs.

    .
    You are welcome.

  7. #7
    Registered User
    Join Date
    02-03-2020
    Location
    York
    MS-Off Ver
    2019
    Posts
    27

    Re: Yes or no confimation before macro runs.

    Hi Logit,

    spreadsheet works which is great (Massive help), however one of the users has pointed out that when they select no on the yesno prompt after changing the cell to invoice complete, it stops the macro but it is leaving the Invoice complete in the cell as text. is there away to get the code to leave this blank? so that they have select it from the dropdown box again?

+ 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. Replies: 2
    Last Post: 10-08-2019, 11:30 AM
  2. [SOLVED] Calculating winning/drawing/losing runs & goal scoring runs
    By gko_87 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 11-25-2017, 06:47 AM
  3. [SOLVED] Macro runs quick initially then bogs down after a few runs
    By pongmeister in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-19-2017, 02:02 PM
  4. Excel Upgrade to 2013, Macro runs erratically with macro assigned to button (shape)
    By sspatriots in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2016, 07:23 PM
  5. VBA runs slow locally, runs fine when connected remotely
    By jbzy324 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2015, 10:05 PM
  6. Override Delete Confimation Dialog Box
    By mpeplow in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2007, 06:23 PM
  7. [SOLVED] Bypass sheets.delete confimation
    By mpeplow in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2006, 05:25 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