Solved

Excel -- upon opening, promt for data input

Posted on 2013-11-03
3
172 Views
Last Modified: 2013-11-03
Experts:

I have a spreadsheet where two critical values drive several associated calculations.

At this time, I've added a simple note in the XLS "reminding" users to ensure reviewing/updated those two values.  

However, to ensure they actually are reviewed/changed, I would like to force their data entry upon opening the spreadsheet.

Value #1 (in cell D1): it is an integer ranging between 15 to 25
Value #2 (in cell D2): it is a fraction.   It can take on only 3 values (i.e., 1/2, 1/3, or 1/4)

Ideally, the on-opening pop-form will utilize a drop-down menu for value #1.   Alternatively, for value #2, radio buttons (or also a drop-down menu) would be great.

Does anyone know how to a) develop the VBA and b) build this linked form?

Thanks,
EEH
0
Comment
Question by:ExpExchHelp
3 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 350 total points
ID: 39619777
Try this macro in the workbook module

Private Sub Workbook_Open()
Range("D1") = InputBox("Enter a value from 15 to 25", "Cell D1")
Range("D2") = "=" & InputBox("Enter a 1/2, 1/3 or 1/4", "Cell D2")
End Sub
0
 

Author Comment

by:ExpExchHelp
ID: 39619790
ssaqibh:

Thx... I've added the code to a module (see attached JPG).

Upon opening the XLS, I'm not prompted for data entry.... it goes straight to the worksheet.

Is there another setting I must verify in order for the macro to be called?

EEH
VBA.jpg
0
 
LVL 26

Assisted Solution

by:MacroShadow
MacroShadow earned 150 total points
ID: 39619796
Don't put it in a new module, put it in the "ThisWorkbook" module.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now