Macro code required for Message Box to prompt for cell location to input data

robertguy

Board Regular
Joined
May 1, 2008
Messages
121
Hi,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
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:-
<o:p></o:p>
(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
<o:p></o:p>
When the user is happy with their choices and presses the OK button the data will be entered in to the cell selected.
<o:p></o:p>
<o:p></o:p>
Any help would be greatly appreciated
<o:p></o:p>
<o:p></o:p>
Many thanks in advance
<o:p></o:p>
<o:p></o:p>
Rob
<o:p></o:p>
N.B. Excel version 2003
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try

Code:
Sub test()
Dim r As Range
If Range("A1").Value <> InputBox("Enter Password") Then
    MsgBox "Wrong password"
    Exit Sub
End If
On Error Resume Next
Set r = Application.InputBox("Select cell", Type:=8)
On Error GoTo 0
If r Is Nothing Then Exit Sub
r.Value = InputBox("Enter value")
End Sub
 
Upvote 0
[Resolved]

VoG<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
many thanks for your prompt reply, this is exactly what I wanted;)<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Many thanks again<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Regards<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Rob<o:p></o:p>
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,981
Members
448,934
Latest member
audette89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top