Email:      Pass:    Pass?
Close Window   
Free Ebook
Get Your Free Excel
Our Top 15 Excel Tutorials
Instant Access!

Subscribe for Free Excel tips & more!

Free Excel Forum

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

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 ...
Excel Data Validation - Limit What a User Can Enter into a Cell
Data Validation is a tool in Excel that you can use to limit what a user can enter into a cell.  It is a great too ...
How to Add a New Line to a Message Box (MsgBox) in Excel VBA Macros
I'll show you how to create a message box popup window in Excel that contains text on multiple lines.  This allows ...
Select Ranges of Cells in Excel using Macros and VBA
This Excel VBA tutorial focuses specifically on selecting ranges of cells in Excel.  This means that you will learn ...

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

Macro Step 1: I have a macro that prompts the user to input requested data into a dialogue box.

Macro Step 2: The macro then takes the data and places it in specific cells.

Macro Step 3: Depending on the responses in step 1, the macro may prompt the user to input more requested data into a dialogue box.

Macro Step 4: If more data is prompted in step 3, the macro takes the additional data and places it in specific cells.

Question: Is there a way to write excel macro syntax code that interrupts the running of the macro (let's say after step 2) to alllow the user to view the cells were the macro placed the data. The macro would then ask if the user approves of the cell input. If user does not approve, the macro would interrupt itself and allow the user to make modifications to the cells. After the user makes any modifications, the user can resume the macro at the point in the macro where it was interrupted.


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 was wondering if there is a way and if so, if could anyone show me a simple code line how one could get user input while running XL macro ?

For example, I want to run a macro to insert data into certain cells and I want the user to be able to input the cell designation via keyboard.

Thanks for any suggestions !

Is there a way to have the user select the correct sheet to continue the macro in without having them type it in?

From other posts I've read how an input box can appear to type in a sheet name, but is it possible for an input box to just wait for a sheet selection?

My current beginning of the macro:

    Sheets("Data Dump").Select
    Selection.Delete Shift:=xlUp
    ' Sheets("Raw Post-Coarct").Select

and I'd like to replace the Sheets("Raw.......").Select with a box that asks the user to select the next sheet.

the reason for this laziness is that I have multiple sheets the Data Dump transformation will feed into, and would rather just have 1 macro and not type the multi word sheet names.

Any help would be great.



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).

I'm currently writing a macro and need the user to be able to enter a user-defined variable within a spreadsheet. So at a particular point as the macro is running, a user specified date will need to be used to determine the number of days between today and then. How is it possible to come up with an input dialog box that then references the input to a specified cell?
Thanks, Tom

I'm working on something that needs an input based off a graph in the middle of the macro. Some of the calculations are needed to continue. I'm opening another userform at that time in order to allow the user to input the new values then they click a button to continue. How do I pause the main macro until user input is done? Or do I need to just bring up the user form and then use input box for the values?

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.

Hey All,

Im working within a workbook that has two workseets called "Input" & "Status". I enter individual information within the "Input" sheet and select a macro embedded that filters all information from the "Input" sheet to the "Status" sheet. Once the macro is finished running it brings me back to the Input sheet for me to enter my next entry.

What I am trying to do is setup a sort macro on the input sheet that will allow users to select 1 sort option from a dropdown list in cell $c$29. Once the user has selected a sort option I would then like to run a macro that sorts all information on the "status" sheet by the item selected on the input sheet.

Within the "Status" sheet all column titles are found in A2:BN2 (these titles are the same as the ones found in the dropdown list on the input sheet)

Is it possible to have a dynamic sort macro in between two worksheets that a user can select (by means of a dropdown list)?


Is it possible to insert a pause in a module for users to input data?

My program will be something like:

1 - Activate input sheet
2 - Message box : "please input evidence" (once the user clicks ok the module normally continues running, whereas I would like it to wait)
3 - program waits as user inputs evidence either in the activated sheet or through an application (Netica, Bayesian network) created by the program
4 - once inputted the program reads the input and does it's stuff

Is this possible? is it easy to do?

since there could be a large amount of evidence to be entered I was thinking of either a timed pause (10 secs) and then a yes/no prompt as to whether all the evidence has been entered, if not the wait an extra 10 secs before prompting again and continuing like this until the user clicks yes or perhaps using just a simple ok button once all the evidence is entered, without the timed prompts...

Thanks in advance for all your help,


I am asking the user to input data, then it asks the user if it wishes to continue. I am trying to build an IF statement that says if the user selects vbYes to continue, then store the input data on a second worksheet. I would also like the user to continue to run through the macro and have the data stored in the next available row, so data gets compiled as the user moves through.

I am running a Macro which requires input from the user. The type of input needed is a date....e.g.08-13-08. What I am looking for is the input box to already be populated with the date, but if the user wants to change it, they can do so. Every week that I run this Macro, the date that I need pre-populated would be the Sunday to follow. If I were to run the Macro any day this week, it would be for 08-10-08. But after Tomorrow (Sunday) passes, If I am to run this Macro, it would be for 08-17-08. Lastly, I would like the input box to only accept dates...if not, end sub or give the user another chance to input. I hope this isn't too much. Thanks in advance.


I am using Excel 2003 and have set up a spreadsheet for a user to input details of keying errors. Basically, I have 3 tabs - Input, Data Table and MI Results. The Inputter is only allowed to see the input tab, they will enter the details, click on the macro and this moves the data into the main Table, which is hidden and password protected.
This works fine for one user. However, I now need this spreadsheet to be used by multiple users (up to 14 at any one time). When I share the workbook, the macros no longer work due to the protection on the worksheets. Is excel able to cope with this, or should I be looking for a different software solution?

Thanks in advance for your help.

Ok, so I have a user input box with ten user input fields. (VBA coded)
Let's say that in field 1 a random number/letter sequence is entered by the user and this same user enters various data into fields 2-6. Then the user commits the entry which causes the data to be sent to another workbook, (database of sorts).
What I need to know. Is there a way of recalling this user input box, with the previous data still intact, based on the field 1 number/letter sequence entered so that another user can finish the data entry in fields 7-10 without causing a duplicate entry in the database???

Much thanks to all that contribute to this forum

Hi all,

I'm wondering if there is a way to create a webpage (intranet) that will request data input from the user and then run an Excel macro on a remote machine and return the output of the macro to the user via the webpage.

The excel sheet currently requires a list of names in column A. When those names are entered columns B through Y automatically update via formulas that pull in data from a local database. After the data is pulled in, a macro can be run that ends up producing a list of all the data in sentence-form. This list is generated into a new, blank workbook and saved to a specific location.

I want to create a page that requests this list of names from the user. Once the user clicks "Go", a script (?) would run that essentially updates the excel sheet with the input data and runs the macro. The final list would then be returned to the webpage.

I'm not looking for a complete solution to this becasue I know this probably requires a ton of custom work. I'm just looking for a jump-off point. I'm not familiar with web applications at all and I'm just wondering where I would get started.


After a previous thread using Vlookups, I think a macro would better suit my needs. I've done quite a bit in process macros to perform tasks but nothing ever having to do with looking up values.

I have a worksheet named "Material Listing" where the data is stored in a range of B3:J35000

I need the data returned to a sheet named "Pricing Lookup" that is in a similar layout as the Material Listing with the first two columns being User Input of Part# and QTY (col B & C).

I need the macro to lookup the Part# (MRN or Material Reference Number) on the Material Listing ws then find the closest quantity (col J on Material Listing tab) to the User Input quantity (on Pricing Lookup ws) and return row data in cols C thru I from Material Listing ws to the Pricing Lookup ws.

It needs to be able to lookup 250 user input lines from the Pricing Lookup ws.

I've converted my workbook but can't figure out how to post it. Its my example worksheet with repeated Part# (MRN's) with different prices per quantity purchased as this is what it will have to work with when actual data is put in.

I left in my previous Vlookups just in case you wanted to see how it was done before hand. But they can be deleted as they don't work when I'm trying to use qty as a constraint for the lookup.

Any help is greatly appreciated

I'm new to using Macros so I need some help with hiding and unhiding columns.

Basically what I'm trying to do is have the user select years of sales to compare.

If it's possible I would like the input the user enters on the INPUT tab in cells B3, B4 and B5 to unhide the appropriate column in the RAW DATA tab so that the chart compares the years selected.

So if the user selects 2007, 2008 and 2009 on INPUT tab then only columns D, E and F would be visible on the RAW DATA tab.

Thanks in advance for any help!

I'm running a macro that can take a while so I want to let the user know that the macro is running OK. I've put the following line in my code

MsgBox "Searching BOM's", vbInformation

The problem is that it requires the user to press OK before it runs the macro, then the box goes off and the macro runs. What I really want to do is display a box that doesn't require user input, and stays on the screen while the macro is running and goes off automatically when the macro is finished. When the macro is finished it will either show a page of search results, or another message box saying Not Found, which requires an OK response from the user.

Hope this makes sense. Thanks for looking at my question, any help greatly appreciated.

I'm new to using Macros so I need some help with hiding and unhiding columns.

Basically what I'm trying to do is have the user select years of sales to compare.

If it's possible I would like the input the user enters on the INPUT tab in cells B3, B4 and B5 to unhide the appropriate column in the RAW DATA tab so that the chart compares the years selected.

So if the user selects 2007, 2008 and 2009 on INPUT tab then only columns D, E and F would be visible on the RAW DATA tab.

Thanks in advance for any help!

I have a workbook that pulls our AD - into a sheet we'll call Sheet 1 - by means of a macro. Column A pulls the full name (first name first, last name last), column B pulls the last name, and column C pulls the first name. In column G, I have concatenated columns B & C appropriately to make a list of last name first, first name last. I have named the data in column G "AD."

On my next sheet - Sheet 2 - I have data validation running in Column A of Sheet 2 on the "AD" list (column G of sheet 1). I have several worksheets that then use the data in columnn A of Sheet 2 as a reference. One of these sheets - lets say Sheet 3 - uses a data connection from Sharepoint to maintain information. Because SharePoint spits out the "full name" from the AD for user data (i.e. First name first, last name last), I need Column B in Sheet 3 to look at the adjacent name in Column A of Sheet 3 (which ultimately leads back to Column G of Sheet 1) and find the appropriate full name (first name first, last name last) that is related to that name from Column A of sheet 1.

I know this seems complicated, but I do have a method to my madness for organizing the workbook this way. I believe the use of "index" with "match" is suggested, but I have not been able to figure out how to do that. Any help would be greatly appreciated.

Can someone show me a form that a user can use to input data, and that these data inputed by user are variable in VB to run the program.

Example (this is only as an example):

the form ask for 3 inputs

these input are actually variables in VB use to run VBA. When someone runs the macro have it ask this input QUESTION. Once all three variables are entered then macro continue, otherwise it stop or if you want to make it challenging, tell them what is missing A, B, or C then run when all are filled.



Hello I have a question about making cells interdependent in Excel.

I have 5 cells that should add up to 100% and 3 that can be manipulated by the user basically:

User Input 1
User Input 2
User Input 3

In column B I have a whole bunch of formulas which are dependent on the percentages.

I want to make it so that the user is forced to input something in User Input 1 and User Input 2. While, User Input 3 is dependent on User Input 2.

So if the user puts in 20% for User Input 3, it takes the 20% from user INput 3 (effectively reducing user input 3). i want to make it so that if the total does not equal 100% there is an error, and if one input is negative that it will also display an error.


this is kind of the idea

Hello! I'd like to have an input box pop up upon running the macro which allows the user to input a number (a date actually). This will then cause cell B3 to equal that date. I have no idea how I'd code this since the only thing I can do is record macros. The cell has a formula in it usually otherwise I'd just have them input the date there But I do think this would be useful to know. I gratefully and eagerly await some VBA knowledge!



I am new to the VBA/Macros world and I find it very interesting. I am trying to create a macros that simply calculates vapor pressure of a given amount of solvents. I have already created the database but now what I want to do is ask the user to input the "name or chemical formula" of the solvent and them my macros will look in the database, find the solvent, and with the information in the database and the input temperature, calculate the pressure. I do not know how to get it to search my entire database (2 columns) to match the input.

Thanks for your help,

I would like to run a macro in the background while a user inputs data, until a condition is satisfied. For example, the macro below should record how long it takes for the user to enter "answer" in the "input" cell.

Sub timeit2()
startjb = Timer
Do While Timer < startjb + 60 'wait up to 60 seconds
DoEvents ' Yield to other processes.
inp = Range("input").Value
ans = Range("answer").Value
If inp = ans Then GoTo correct 'check if correct answer
Range("elapsed").Value = Timer - startjb 'record elapsed time
End Sub

However, when I run this macro it stops executing as soon as the user tries to enter any data in the worksheet (correct or not). Is there a way to make it keep running in the background until the condition "input = answer" is satisfied?

Thanks for any advice!