Close Window   
Free Ebook
Get Your Free Excel
Our Top 15 Excel Tutorials
Instant Access!
Subscribe for Free Excel tips & more!

Macros Waiting For User Input

Forum Register
Search Excel Forum Posts, Tutorials, Macros, Tips, and More

I am trying to put together a macro that waits for the user to input data and then continue running the macro.

All user input is for one cell and I am looking at more of an entire sheet worth of data.

Here is the scenerio.

I have one tab that pulls data out of a sharepoint list. I then have another tab that I dump data from another database into and then use vlookups to compare the data.

The problem is I need it update the sharepoint list. Then wait for the user to dump in the new data from the external database before continuing the macro and working with the vlookups.

Currently I am working this by running a few different macros to do it all, but I would like to condense it down to running one macro.

Thanks for any input and help.

View Answers     

Similar Excel Tutorials

Get User Submitted Data from a Prompt in Excel using VBA Macros
How to prompt a user for their input in Excel. There is a simple way to do this using VBA and macros; we use the I ...
Excel Prank - Prevent Closing a Workbook
How to prevent a user from closing an Excel workbook. The user won't know what to do! This is a great little prank ...
Make Users Enable Macros in Order to View a Workbook in Excel
Tutorial showing you how to make a user enable macros in a workbook in order to view the workbook. This is very im ...
Guide to Combine and Consolidate Data in Excel
Guide to combining and consolidating data in Excel. This includes consolidating data from multiple cells, multiple ...
Run a Macro when a User Does Something in the Worksheet in Excel
How to run a macro when a user does something in the worksheet, everything from selecting a cell, to editing a cell ...
Get Data from the Worksheet into a Macro in Excel
Here, you'll learn how to get information from the Excel worksheet into a macro so you can do something with it. O ...

Helpful Excel Macros

Add an Input Message to a Cell - Message Appears When the Cell is Selected in Excel - Data Validation Macro
- Add data validation input messages to cells in Excel with this free Excel macro. These messages appear when a specific
Add a Drop Down Menu to a Cell in Excel - Data Validation Macro
- Add a drop down menu or list to a cell in Excel with this free Excel macro. This is a great little macro that allows yo
Get Values from a Chart
- This macro will pull the values from a chart in excel and list those values on another spreadsheet. This will get the s
Sort Data that Doesn't Have Headers in Descending Order in Excel
- Sort data in Excel that doesn't have headers using a macro. This Excel macro assumes that your data set does not have a
Display the AutoFilter Criteria Applied to a Data Set in a Cell in Excel - UDF
- This free Excel UDF (user defined function) allows you display the filter criteria that has been applied to a data set i

Similar Topics


I have a report in Excel which I have published in MOSS (Microsoft Office SharePoint Server). Now the problem is that I have lot of Excel Macros which need to run based on the user input. It works fine in Excel, however, I am not able to replicate the same onto the Sharepoint.

In Sharepoint the report is just available on a viewable basis with no interactivity for the user to view the data as he would like to.

My question is

Is it possible to make the Excel Macros work in SharePoint. In a nutshell, can Excel and SharePoint communicate with each other, without the user having to download the Excel file to make the changes?

If this is not possible, what are the other available alternatives. Can the Excel macros be programmed in some other language so that the report can be made dynamic?

Any suggestions are greatly appreciated.


I have a workbook with a couple of straightforward macros activated on buttons on a couple of different sheets.
Thanks to the penultimate knowledge on this board, I have been able to figure out how to store data and use this to create an "Undo" macro (sort of) that resets everything back to it's original condition. My question is:
If a user hits the "Reset" button, it will reset all their data back to the original. I want to want the usr with a popup message, and give hem the option of hitting "OK" or "Cancel". I can create a simple MsgBox popup, and I know how to create a UserForm, but I'm lost with:
A: Pausing the macro from running the rest of the script until after the user has hit OK. And/Or:
B: Having a User Form Popup to give the user the option of hitting Cancel to stop the macro from running without an error message, and just continuing with entering data into the spreadsheets normally.
Am I better off with a MsgBox or a UserForm, and how do I accomplish the OK or Cancel options and pause my script until input?
Thank you in advance for your help (Once again).

Well, here is what I am trying to do, and how I am going about doing it. I have a couple of questions. Maybe there is a better way of doing this.

I created a custom toolbar that currently has 7 macros on it. When the workbook opens, it automatically loads the toolbar. There are a couple of macros that I don't want everybody to be able to run. I have a worksheet that has some validation information in it. There is a list of user names with a column that basically states whether or not the user should have access to all macros.

What I planned to do was find the user that was running the macro. Look them up on the validation worksheet to see if they can run all macros. If not, then don't let them execute the macro (exit the macro).

How do I find the user trying to run the macro? The spreadsheet is not a shared spreadsheet. Only one user can be in it at a time. I was going to use...
ActiveWorkbook.UserStatus(1, 1)
However, is this the best thing to do? Is it really telling me who the user is that is running it?

Is there another way to prevent the user from running certain macros?

Thanks for the help.


What I require is the macro code (which I will be running from a button) that will pop up a message box asking the user for the password (which will be hidden in A1), after verifying the password is valid the user will be then prompted for the following information:-

(a) cell reference e.g. F1, G9, AB56 etc etc
(b) data to be input in cell range defined e.g. test data etc etc

When the user is happy with their choices and presses the OK button the data will be entered in to the cell selected.

Any help would be greatly appreciated

Many thanks in advance


N.B. Excel version 2003


I am wondering how to disable temporarily anything under "Worksheet_Change" while running a particular macro. Under Worksheet_Change, I have some auto-formating rules, which require the user to input data depending on the value of the cell, but I would like all those input (and everything under Worksheet_Change) to be disabled when executing one of my macro...

Hopefully that's clear enough, let me know if it's not

OK, I have a sheet with some pretty time consuming macro's which run to configure the layout, details and maths on many sheets depending on user input. I know that my code is probably the cause of most of the time taken to run these macro's, but I am new to using macro's and VB in Excel and still learning good code structure etc. So anyway, the upshot is that i have pieced ogether a progress bar from other buts of code i found on the net. The diference is my progress bar does not try to time itself to the macro that is running but rather just goes to 100% then returns to zero and goes up again. In the code for the progress bar, i use two loops, one which determins the speed the bar rises at, and the second determins how many cycles the bar should run for. My aim was to use the bar for all my macro's so it appeared whenever a macro was run and then disappear again when the macro was complete. I have now learned that when I trigger the progress bar (its done using a userform) the macro that triggers it stops and waits for the progress bar to finish running before continuing. This obviously defeats the object of the exercise and of course makes running the macro's even longer than normal.

So my question is: Is there a way to let my original macro continue to run while the progress bar is displayed?

Sounds easy, Or maybe I'm more dumbererer than i give myself credit for.

Any help much appreciated.


Hello all. Im new with Macros and would like to seek your help.

I would like a macro to filter the USER, START DATE and END DATE depending on user input.

Any help on this would be highly appreciated.Book1.xls

I am writing a simple macro and I am using the "input" fuction to gather some information from the user. So when someone clicks on the button attached to my macro an "InPut" box pups up and asks for the target value. That part works great but the problem is that if the user decided to click on the "cancel" button or hits "escape" an error message is generated. How Do I get arround this so that they user can stop running the macro by clicking on the "escape" button or hitting the "escapte" key. Thanks in advance.

I need to connect database with Excel using macros. I want to fetch data by running macros from Excel sheet and want to import data in excel.

Can anyone please help me in writing macro code to connect the database and extract data.
I have following database details with me :
User name : abctest
Password : ********
Host : abc408
TCP Port: 1234
SID : cq30

Please write a code using the dummy details provided above.
many thanks in advance for your help.


I am trying to create a simple macro that will find text based on user input. I tried recording a macro using the edit/find tool, but it won't let me go further with out entering the actual data. For example, I have a worksheet containing 1000 Last names, I want the user to be able to find any last name by entering a value as the search criteria.

I can write macros using the macro recorder, but may need more in depth help if the answer is visual basic.

Any help would be greatly appreciated!

Hi, I have simple question...I'm trying create little script where I will be able filter based on user input. For example I have column L (Order Date), when I run macro input box will show up so user can add date. When user type in date, all data that are equal or less then user input will be deleted.

So if, Filter all date that are less or equal ##/##/##, I got following code but when I run it it does not filter my data. Can anybody tell me what I'm doing wrong in here or can somebody tell how would I do this?

HTML Code:

'Get the filter's criteria from the user
        sDate = InputBox("Enter the Condition to Filter ##/##/##")
'Filter the data based on the user's input
        Selection.AutoFilter field:=12, Criteria1:="<=" & CDate(sDate), Operator:=xlAnd

Thanks a lot


I desperately need help in excel vba. I wrote a macro which creates desired output based on one default variables. But I want to change it to take user selected assumptions and perform the macro for each user selected variables.

I am confused with user forms and controls and what to use.

Can anyone give the code to how to add a list box to a userform and then add items to the listbox, and run macro based on thegiven input in the list box??


i have a macro that checks the validity of a value before the user is allowed to use the workbook.

while the macro is running a userform is displayed .
the problem is that if the user presses esc while the macro is running the macro goes into debugging mode.even if i password protect the code the sheet is available for the user.

how can i prevent the user from breaking the runnig macro?????

I want my user to be able to check some boxes in a UserForm AND to edit some data in his sheet before the code continues.

According to the Show Form help "When a UserForm is modeless, subsequent code is executed as it's encountered." So, if I use a modeless form the code continues running without waiting for the user's input.

As far as I can see, the only way around this is to put "UserForm.Show vbModeless" as the last line in one macro and trigger the continuing code in a second macro from the form's own Private Sub cmdOK_click().

Is that right, please?


I have a macros to filter data based on user input that works just fine. My problem is when the user input is supposed to be the data excluded from the filter my macro doesn't seem to filter out the undesired data. (Data is date related with one filter asking to see data from a specific date and the other fliter asking not to see data from a specific date. My code is below...can anyone see my mistake? Thank you in advance for your help

To include specific date:
'Get the filter's criteria from the user
FilterCriteria = InputBox("Enter Scheduled Downday.(MM/DD/YY)")
'Filter the data based on the user's input
Selection.AutoFilter Field:=12, Criteria1:=FilterCriteria

To exclude specific date
'Get the filter's criteria from the user
FilterCriteria = InputBox("Enter Scheduled Downday.(MM/DD/YY)")
'Filter the data based on the user's input
Selection.AutoFilter Field:=12, Criteria1:="<>FilterCriteria"

I can not figure out how to handle a Userform Texbox input error. The snipet of code in my Command Button macro is:

If UserForm1.TextBox1.Value = "" Then
MsgBox "You must Enter a New Name", vbOKOnly, "Update Error"
Cancel = True
End If

If the user fails to input anything into the textbox, I would like to return to the start of the macro, (let them try it again). Currently, this code just continues running the next macro steps after the user clicks the OK button.
Can anyone provide some guidance as to how I return to the previous step if the Textbox input is blank?


I'm a novice at macros and don't know VBA, so I'm hoping someone can help me set up a simple interactive macro. I want to create a macro that will disable protection on the sheet, copy a row, insert the row, then bring up the find/replace window for user input, then continue with the macro. The only part I can't figure out is how to bring up the find/replace window for user input and then continue with the macro. Can this be done using Excel tools or would I have to learn VBA? Could you provide some guidance on the steps needed to accomplish this? Thank you.

I am building a macro that deals with a lot of data and takes several minutes to run. I want to display a message to the user stating "Calculating..." while the calculating is taking place. I got the idea to use a userForm with a label on it. The problem is that excel waits for input from the userform before continuing the calculations.

How do I display the userform, continue doing the calculations, and then hide the userform when the calculations are complete? (without any input from the user)

I currently have:

        Call module1.functionX

Ladies, Gents,

When the macro is running, it effectively stops the user from selecting any cells, or working within the spreadsheet in any way.

I need the spreadsheet user to be able to pause the running macro via a set of key strokes eg CTRL p for Pause (or other method?).
When the macro is paused, the user can jump into the spreadsheet and "do their thing" eg select a cell for a title, do a graph and print it etc etc. Then when he or she is ready, resume the macro from where it paused with another set of keystrokes (or other method - button?).

They should be able to do this as many times as they like while the macro is running.

The application is Data acquisition from a measuring device, where there can be an hour or more between 1 reading and the next.

Any help here would be appreciated.




I would like to use an input box to obtain a user password before the rest of a macro is run. Is there a way to mask the user input as it is entered, as is commonly done for passwords (e.g., if the user types in bamboo6 in the input box, Excel recognizes bamboo6 as the password response, but it shows up on the screen as ******* as the user enters it)?

Thanks for any help.


Hi expert,
I hava a text box on a userform.
i would like to ;
1) once userform done/ input data in userform , macro run.
ex: if user input "start" in text box, after 2 second ( whihc is done input value), macro automaitcally run without pressing any button or key.

please advise.....

Hi all - trying to set up a input box that becomes active as soon as
the user opens the workbook. The data primarily contains sales info
with country, region and city tags so I'd like the user to make a
choice upon opening within one of three possible filters (maybe they
just want to look at US or maybe they want to look at Missouri or maybe
they want to look at St. Louis).

I'd like for the user to basically choose from a list for what they
should be filtering on (instead of having to type it as input)

(Actually I wish my users could just get over the mental block of
making their own filter choices without having to set this up as a
macro but we aren't there yet...)

Can anyone offer assistance? Thanks if you are able - Gretchen

Has anyone discovered a way to suspend a running macro to allow input to a cell on the active worksheet? Upon entry control would be returned to the macro for manipulation of the entered value.
I do not want to us an InputBox, MsgBox or User form.


I am trying to create a macro that will allow employees to sort a product matrix in excel. The user would select up to six criteria for sorting by simply clicking on the headers over the columns. I would prefer not to use a list box, since the list is quite long and sub-catagorized.

Idealy, a message box or input box (or something similar) would ask the user to select the six criteria in order of priority by clicking on the header cells in row 3, then pass execution back to the macro.

I am struggling with finding a way to pass control to the mouse (mid-macro execution), capture/select the cells, then pass execution back to the macro. I searched the forum database and web, but found nothing similar.

Can anyone, please help?

Thank you in advance!


Can you please tell me how to insert "Please Wait..." while the macro is working it's magic in the background?

So ideally when the user runs the Macro they will see a white screen with the text "Please Wait..." - no blinking - and then when the macro is finished it will display.

Thank you ~

A newbie - but learning FAST!