ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Dialog Box (https://www.excelbanter.com/excel-discussion-misc-queries/16446-dialog-box.html)

Aussie

Dialog Box
 
I need some simple advice on how to make a dialog box launch with the auto
open macro to have a value entered by the user and pasted in a cell on the
worksheet. Thanks in advance.



Peo Sjoblom

Look in VBA help for Application.InputBox
I use this in an autofilter for entering are codes when filtering on phone
numbers

Sub Area_Code()
Application.ScreenUpdating = False
UserVal = Application.InputBox("Enter Area Code")
If UserVal = False Then
Exit Sub
Else
Selection.AutoFilter Field:=4, Criteria1:=UserVal & "*", Operator:=xlAnd
End If
Application.ScreenUpdating = True
End Sub


--

Regards,

Peo Sjoblom

"Aussie" wrote in message
...
I need some simple advice on how to make a dialog box launch with the auto
open macro to have a value entered by the user and pasted in a cell on the
worksheet. Thanks in advance.






All times are GMT +1. The time now is 04:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com