Using Default text with Inputboxes

  • Thread starter Thread starter Sean Stuber
  • Start date Start date
S

Sean Stuber

I'm trying to make default text appear in an inputbox but it is not
working. The default text should be any values that currently exist in
the range. My code is below.
Thanks for the help.
Sean

Sub EditParkingLoc()

'\ edit Parking Location data values in detail report
Application.ScreenUpdating = False
ActiveSheet.Unprotect
Default = ActiveSheet.Range("ParkingLoc").Cells(1, 1).Value
ActiveSheet.Range("ParkingLoc").Cells(1, 1).Value =
InputBox(prompt:="Enter new/modified Parking Location:", Title:="Edit
Parking Location", Default:=Default)
ActiveSheet.Protect
MsgBox "Parking Location successfully modified.", vbInformation,
"Record Changed"
End Sub
 
Hi Sean

Sub EditParkingLoc()
Dim myvalue As String
myvalue = ActiveSheet.Range("ParkingLoc").Cells(1, 1).Value
Application.ScreenUpdating = False
ActiveSheet.Unprotect
ActiveSheet.Range("ParkingLoc").Cells(1, 1).Value = _
InputBox(prompt:="Enter new/modified Parking Location:", _
Title:="Edit Parking Location", Default:=myvalue)
ActiveSheet.Protect
MsgBox "Parking Location successfully modified.", _
vbInformation, "Record Changed"
End Sub

--
XL2002
Regards

William

(e-mail address removed)

| I'm trying to make default text appear in an inputbox but it is not
| working. The default text should be any values that currently exist in
| the range. My code is below.
| Thanks for the help.
| Sean
|
| Sub EditParkingLoc()
|
| '\ edit Parking Location data values in detail report
| Application.ScreenUpdating = False
| ActiveSheet.Unprotect
| Default = ActiveSheet.Range("ParkingLoc").Cells(1, 1).Value
| ActiveSheet.Range("ParkingLoc").Cells(1, 1).Value =
| InputBox(prompt:="Enter new/modified Parking Location:", Title:="Edit
| Parking Location", Default:=Default)
| ActiveSheet.Protect
| MsgBox "Parking Location successfully modified.", vbInformation,
| "Record Changed"
| End Sub
|
|
|
|
| Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top