Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create MessageBox to promt me to select data in DropBox

Status
Not open for further replies.

RooSXL

Technical User
Sep 22, 2004
22
US
I am trying to create an excel report that will gathering information from different files and it will mainly be driven by macros trigerring macros. However there a couple of cells that require some information in order for the macros to pick the right files. How create a macro that will prompt the user to input data in particular? NOTE: Cells have dropboxes in order for the user to only pick valid information. Does anyone know an easy way to do this?

Thanks,
 
I am not following the problem. If you have macros firing macros, surely it would not be difficult to do some error trapping on valid input, and simply display a MsgBox telling the user what to do.

If a macro requires valid data in a particular cell, or rather, the user picking SOMETHING from a dropdown, then test for that condition.

How are the macros being fired?

Gerry
 
I am not familiar with error trapping on valid input, because the user needs to select month from a dropbox and the rest of the procedures is automatic.

The below is the first macro to be ran, and it will open another file in the server and update the information in my sheet. However the file to be picked changes monthly, therefore you need to manually change or pick from a dropbox the month that you want to run the report for. O4 contains a dropbox to select month.

Sub Get_DataFrom_VarianceBook()
Dim StrFileName As String
Sheets("Month").Select
Range("O4").Select
StrFileName = ActiveCell.Value

Workbooks.Open Filename:= _
"S:\ACCT\CostDept\WD Variances & Recons 2004\Variance Books 2004\" + StrFileName

'Grab the Variance Book Data
Windows(StrFileName).Activate
Sheets(2).Select
Range("F1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=7, Criteria1:="411"
Selection.CurrentRegion.Select
Selection.Copy
Windows("ME Performance Report Plants.xls").Activate
Range("h7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows(StrFileName).Activate
ActiveWindow.Close


End Sub



This is how I calling or firing the macros>>>

Application.Run "PERSONAL.XLS!PasteSpeciaValues"

I would appreciate if you can give me further detail as to how test for a condition.

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top