Dialog Box To Confirm Running Macro

Oct 18, 2005

i have a macro button designed to wipe all user entered data into a workbook. I want it so you cant accidently press (as you cannot undo the operation). Anyway for making a dialog box appear asking if you are sure to wipe date, with a yes or not option.. no will obviously abort the macro.

if possible, another box to come up asking if you want to save the file first with a different file name (comes up with a save as box).

this is the code so far:


Sub MonthCleaner()
'
' MonthCleaner Macro
' Macro recorded 17/10/2005
'

Application.ScreenUpdating = False

Range("A10:G10").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("H10").Select .........

View 9 Replies


ADVERTISEMENT

Confirm Selection Before Running Macro

Oct 5, 2007

I have an excel form where users can input modifications by selecting a range and then pressing a command button to input a value in the selection.

My goal is: to restrict the location where a user can select a range of cell and then execute the macro . The cells where the user can use the macro are merged and in my code, I used the address as show in the address bar in excel for their location. If the user select a cell that is not permitted, a message box is displays and exits the code.

If (Selection.Address <> Range("AE7").Address) _
Or (Selection.Address <> Range("BM7").Address) Then
Msgbox ("Wrong location") Else

For some reason it doesn't work since the message box appears even if I am within the permitted locations.

Note: AE7 is the first cell of a merge, same as with BM7

View 9 Replies View Related

Confirm Prompt Before Macro Runs

Nov 20, 2006

I have a button. When pressed, it runs a macro. Instead, after pressing the button, I would like the user to confirm to run the macro and display some info about it. This is to make sure the user does not accidentally run the wrong macro (button). I just need a prompt box, with a line info, and the two choices YES and NO. If NO is selected, nothing happens. If YES is selected, macro continues.

View 6 Replies View Related

Macro For Sending Emails :: Pop Up Confirm And Cancel

Oct 13, 2007

I'm using Excel 2002 on and XP machine. I am creating a spreadsheet to track a work plan.

Column A: Name
Column B: Date
Column C: Time
Column D: YES
Column E: No
Column F: New Date
Column G: New Time

What I'm looking to do is input click able buttons in Columns D: Yes and Column E: No.

When a user clicks on YES, a pop up window should appear with the data in columns A,B,C.

The p0p-up should contain CONFIRM and CANCEL buttons.

Asking the user if they want to confirm the date and Time.

If CONFIRM is clicked Excel should then send an email to me and the user to say that the work schedule has been confirmed.

If CANCEL is clicked the pop-up window closes.

Secondly if the user clicks NO, a pop-up window should open with two free text boxes. One for Proposed date and One for Proposed time. And again 2 buttons for Confirm and Cancel.

If Confirm is clicked then Excel should record the data entered in the free text boxes into Column G and Column H and send emails to me and the user with the Proposed date and Time Data.

If CANCEL is clicked the pop-up window closes.

View 9 Replies View Related

After Macro Saves File Msgbox To Confirm Save As Completed

Jan 18, 2014

I have a macro which works well. All it does is save a file to a specified location on my network. However, after a file is saved there is no prompt telling the user that the file was saved successfully leaving them wondering whether the macro actually worked.

VB:
Public Sub SaveAs() ThisFile = Range("X2").Value
ActiveWorkbook.SaveAs Filename:="legdcAudits" & ThisFile & ".xlsm", FileFormat:=52
End Sub

View 1 Replies View Related

Macro - Hold View And Avoid Confirm Delete Message

Feb 11, 2009

1. I can't remember it, but I know there is a command so that the view hold and that the selected tabs and cells does not show and the same view remains until the "unhold" is called in the macro. THEN the view is updated. What is this command again? Could not find it...

2. The macro needs to delete tabs at the click of a button (easy part) but for each deletion, a message appear:

Data may exist in the sheet selected for deletion. To permanently delete this data, press Delete. Is there a way to prevent the message from popping out when the macro is executed?

View 2 Replies View Related

Macro Won't Appear In Dialog Box

Jan 3, 2013

I have some code in a standard module. When I try to run it, it does not appear in the dialog box. The code's below.

Code:
Sub CopyCat(ByVal Target As Excel.Range)
If Target.Column 21 Then Exit Sub
If Target.Value = "Y" Then
Cells(Target.Row, "A").Copy Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)
Cells(Target.Row, "B").Copy Destination:=Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1)
Cells(Target.Row, "C").Copy Destination:=Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1)
Cells(Target.Row, "D").Copy Destination:=Sheets("Sheet2").Range("D" & Rows.Count).End(xlUp).Offset(1)
Cells(Target.Row, "E").Copy Destination:=Sheets("Sheet2").Range("E" & Rows.Count).End(xlUp).Offset(1)
End If
End Sub

View 9 Replies View Related

No Macro But Dialog Still Appear

Jan 29, 2007

I am very sure that I have deleted all my macro in my excel spreadsheet and saved. However, when I tried to open the file, the macro dialog prompt me again..... I have press alt F11 and confirmed that there is no macro.

View 6 Replies View Related

A Macro That Can Be Used To Open Different Dialog Boxes

Feb 9, 2007

I want to record a macro that can be used to open different dialog boxes e.g conditional formatting, go to, sort, paste special etc.

what should be the way to record a macro to do this. I have tried it but to stop macro recorder I have to close the dialog box first but in this way it records nothing.

View 9 Replies View Related

Macro To Bring Up Save As Dialog Box

Feb 20, 2007

I am modifying a corporate macro that is used in to create a standard technical letter. This standard file has 6 macros, that once used to create the letter, are never used again. I know, the first thing that jumps out is to create an add-in. I'd prefer not to got hat route at the moment for various reasons.

What I'm looking to do is after the letter is created, and the print macro is called and prints the letter, all macros are removed (already found help for this on this site), then check to see if the file has been saved, or still has the template name, and then either save or bring up the save as dialog box for the user to save the file with the appropriate name and folder.

View 9 Replies View Related

Macro - Dialog Box On Excel File Launch?

Jul 8, 2013

I'm looking to create a macro that launches a dialog box upon file launch. Based on the input, I want excel to only show the tab which corresponds to the dialog box entry.

For example, if it asks "What is your name?" on file launch and I respond "Alex"; i want the tab labeled "Alex" to only be shown for the user.

View 1 Replies View Related

Macro To Open Dialog Insert Object

Jul 19, 2013

I am trying to add a simple function to button in Excel.

First I need to select cell G24 as that where the inserted file should be placed on the worksheet. Then on the Add Object window to open but the tab 'Create from file selected.

Below is only part of the solution
Sub ShowInsertObj()
Application.Dialogs(xlDialogInsertObject).Show
End Sub

Also is it possible to detect that file has been placed on the page ? In cell G24?

I am wanting users to attach a required zip file. I then need to check if they have done so.

View 1 Replies View Related

Excel Macro And Download Dialog Box In IE11

Apr 19, 2014

Back in IE8, when you tried to download a file, it'd pop up a little box asking if you wanted to download or save the file. Macros in Excel could work through it using code like 'hWnd = FindWindow("#32770", "File Download")' to get the box and interact with it.

IE11 now has an obnoxious little ribbon that appears at the bottom of the window instead of the box, so FindWindow comes up blank.

There are a number of files including .xls, xlsx, and .csv, and there isn't a static link directly to the files, so I can't just put the link in workbooks.open. Also, to get some of the files, there are logins and forms to fill in with dates and the like. I can get through all of that stuff and click the button to download, but it's that open/close button that's stumped me.

Any way to get an Excel macro to interact with that Open/Save ribbon in IE11?

View 1 Replies View Related

Password Protect/Unprotect Dialog Macro??? !

Mar 4, 2007

Stumbling over syntax on what should be easy. I want to password protect the active sheet using plain vanilla user input box; and then unprotect ALSO via an input box. Doesn't matter about masking the input with **** or whatever. Based on responses below, here is macro code I used:

To protect the sheet:

Sub ProtectSecurity()
Dim pword As String
pword = InputBox("Enter Password", "Password")
ActiveSheet.Protect pword
End Sub
---------------------------------
To Unprotect the sheet:

Sub UnprotectSecurity()
Dim pword As String
pword = InputBox("Enter Password", "Password")
ActiveSheet.Unprotect pword
End Sub

View 5 Replies View Related

Macro To Create Dialog Box For User Instruction

Jul 24, 2007

I have a workbook with 23 pages, each running a macro to calculate the final "answer".
I would like to make the title page comman button create a dialog box, listing the 23 pages/macros with a check-box for each (default is "checked") asking the user which macros / calculations to execute. Any ideas how to do this?
I am trying to avoid making this a sheet in my workbook.

View 9 Replies View Related

Replace Keyboard Shortcut For Macro Dialog

Jul 19, 2006

I would like to replace the keyboard shortcut for the macro dialog box
The standard Alt + F8 is on the right side of the keyboard

I would like somethine of the left side such as Alt + Q

View 3 Replies View Related

Stop Macros Showing In Macro Dialog

Dec 9, 2006

I've forgotten how to prevent the macros from showing in the macro dialogue box.

I'm sure it's got to be something with the VBA editor, but I can't figure it out.

I've got some files where the macro list is hidden and I'd like to do the same again, but for the life of me....I'm stumped. I'm sure it's something very simple.

I've protected the Worksheet & Workbook.

I've done some searching...."macro hide", "hide dialogue" etc. but can't seem to find what I'm looking for.

It's been a while since I had to amend code, as everythings been running very smoothly.

View 5 Replies View Related

Macro To Call Up Micro Strategy Reports Dialog Box

Oct 22, 2013

Would like to be able to have a macro button or code that launches the Microstrategy Reports dialog box.

View 2 Replies View Related

Macro To Create A Dialog Box For Entering And Updating Drop Down List?

Oct 31, 2013

This is what I'm trying to do:

1. When a user clicks on a Drop down box and selects "Add New", I would like a Macro to run

2. I want this Macro to open up a Dialog/Text box to say "Enter New Information" where the user can enter in some text

3. The text that is entered by the user into this box will be added as a new entry into the Drop down box selection

My VBA knowledge is still at a beginner's level and I know how to get a Macro to run based on a cell value. However I don't know how to create a Macro for the dialog box nor do I know how to create a Macro for updating the drop-down items.

View 8 Replies View Related

How To Confirm Whether Particular Value Exists In Range

Jun 4, 2012

How I can confirm whether a particular value exists in a range. i.e.

ABCD11Yes/No22

Does the Number 4 exist in the range

A1:A8?334455667788

View 3 Replies View Related

Search And Confirm Function Setup?

Aug 19, 2013

I have to do a project, but I'm not really sure how to go about it. Here's my problem: I have about 200 stock ticker symbols already given(ie. AAPL, MSFT, NEE, etc...), and i have to create an excel file where i would copy/paste or enter in another set of stock ticker symbols and would give me back the answer if any of the newly entered symbols match the ones i already have(either in form of 1 or 0, YES or NO etc...).

View 4 Replies View Related

Confirm Save As - Change Default?

Jan 5, 2014

Whenever updating an Excel file and saving it as a new file, a "Confirm Save As" window appears. The default is "NO" (No is Highlighted). Conversely, in MS Word, the default is "Yes" (and, YES is highlighted). I would like to change the default from NO to YES in Excel.

View 1 Replies View Related

Ask User To Confirm Delete Action

Jun 18, 2014

I'm trying to prompt user when he tries to delete a value from a cell so he can confirm is action but not the same way to all cells.

Let's say that I have cells A1:F10 with values, and user should be able to change this values but not to delete them (can't be a blank cell) and I want to prompt him that info (something like "Cell can't be blank!").

In other range a want a different thing: let's say cells H1:K20. In this cells user should be able to change cells values and also delete them but I want to ask him for a confirmation (something like "are you sure").

View 7 Replies View Related

Pop Up Form Within Userform To Confirm Choice

May 11, 2009

pop up form within userform to confirm choice. I have a button within a userform that clears the form:

View 5 Replies View Related

Confirm True In Logical Test Using Find

Nov 9, 2009

I'm trying to use the following formula to verify if the "," is within a cell. Something is not right, because even for True conditions, I'm getting a False return. I think my True logical test is not written right.

View 3 Replies View Related

Avoid Message Box Asking To Confirm Deletion Of Worksheet

Jul 18, 2007

I've written some VBA which creates worksheets to temporarily store data in. At the end of the code I delete the worksheets. However, for some reason I am getting a message box which asks for confirmation. How can I avoid the user of my report having to click OK for each of the worksheets which need to be deleted?

View 3 Replies View Related

Compare & Confirm Dates In Column To Date In Cell

May 21, 2008

I am trying to do a macro that looks to see if the date is different from one cell to another going down in rows. I got it to work until the cell is empty then it says the date dont match but I just want it to stop the loop. so it should go down a list check to see if the date is the same all the way down the list, stopping if cell is blank, if not give a message box, if it is the same stop.

Is As follows

Dim rowNum As Integer, colNum As Integer, currCell As Range

rowNum = ActiveCell.Row
colNum = ActiveCell.Column
rowNum = rowNum + 1
'get first cell
Set currCell = ActiveSheet.Cells(2, 3)
'loop while cell not empty
Do Until currCell.Value = " "
If currCell.Value = ActiveSheet.Cells(2, 3) Then
If currCell.Value = "" Then
End If

View 4 Replies View Related

Macro Stops Running The Macro Completely And Hangs In The Middle

Jul 3, 2007

Here in our department we made a pretty elaborate macro that takes a report and sorts them out to 17 different sheets in a one workbook. This Macro pulls a file from a specific location on our server and then opens the CSV sorts it out color codes all the important information and saves it back onto the server under you specific initials.

They are four PC's along with our Managers laptop that run this Macro daily.

About 3 weeks ago my Managers laptop stops running the Macro completely and hangs in the middle of the whole thing. Eventually crashing Excel.

We try to remove the modules and re-import them back into the personal macro workbork but this does not work. The Macro's did not change and still fully function on the other four desktops to this day.

I uninstall Office on my Managers laptop and reinstall. Import the Modules again and still hangs up in very same spot it did 3 weeks ago.

I've tried to lower the macro security to the lowest level also and I've still had no luck with this laptop. I don't understand. The Macro's function perfectly on other PC's but will not function on this laptop.

View 9 Replies View Related

Running A Macro When A Value Is Reached In A Specific Cell Used To Call Up Macro

Jan 7, 2009

I have a Sheet sheet1 and I want to run a macro when the cell D2 in Sheet1 is equal to 10,7,5,and 3. I only want this macro to run when those values are reached the macro then puts the data onto a sheet called wps. The macro is run as a module and is a sub macro.

View 9 Replies View Related

Macro To Check If Saved Then Save Else Bring Up Save As Dialog

Sep 6, 2012

I'm trying to make a macro check if a file has been saved (ever). If so I want the macro to do a regular save (with already esatablished filename and location) before it proceeds with the rest of the macro. If the file hasnt been saved (if it runs from a new workbook) then I want it to pop up the save.as dialog, so that the user can choose the name and location of the file before the macro continues .

The macro itself is saved in personal.xlsx.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved