ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Input box data check (https://www.excelbanter.com/excel-discussion-misc-queries/214617-input-box-data-check.html)

Mark[_8_]

Input box data check
 
Hello everyone,
I'm trying to create an input box that woulk ask for a worksheet name, which
is one of a hundred worksheets. If the name is incorrect or a name is not
given then a msg box would come up and repeat the request again. After 3
times a file will appear to assist the user. How can I resolve this. Thanks.
--
Mark

Don Guillett

Input box data check
 
Maybe use a drop down with a list of the sheets.
http://www.contextures.com/tiptech.html

Or, a worksheet_double click event to goto the sheet where the name is in a
cell. Make a list using a macro.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mark" wrote in message
...
Hello everyone,
I'm trying to create an input box that woulk ask for a worksheet name,
which
is one of a hundred worksheets. If the name is incorrect or a name is not
given then a msg box would come up and repeat the request again. After 3
times a file will appear to assist the user. How can I resolve this.
Thanks.
--
Mark



Mark[_8_]

Input box data check
 
Hey Don thanks. I just got back on and noticed your reply.
I did put the following together but it doesn't answer everything that I
need. i will check yours out. Here's what I put together:
For Each ws in Worksheets
If ws.Name = Inputdata Then
ws.Activate
Exit Sub
End If
Next
--
Mark


"Don Guillett" wrote:

Maybe use a drop down with a list of the sheets.
http://www.contextures.com/tiptech.html

Or, a worksheet_double click event to goto the sheet where the name is in a
cell. Make a list using a macro.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mark" wrote in message
...
Hello everyone,
I'm trying to create an input box that woulk ask for a worksheet name,
which
is one of a hundred worksheets. If the name is incorrect or a name is not
given then a msg box would come up and repeat the request again. After 3
times a file will appear to assist the user. How can I resolve this.
Thanks.
--
Mark




Don Guillett

Input box data check
 
This sub will made a list of your activeworkbook sheets in col A. Then you
can use my doubleclick

Sub listsheets()
For i = 1 To Sheets.Count
Cells(i, "a") = Sheets(i).Name
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mark" wrote in message
...
Hey Don thanks. I just got back on and noticed your reply.
I did put the following together but it doesn't answer everything that I
need. i will check yours out. Here's what I put together:
For Each ws in Worksheets
If ws.Name = Inputdata Then
ws.Activate
Exit Sub
End If
Next
--
Mark


"Don Guillett" wrote:

Maybe use a drop down with a list of the sheets.
http://www.contextures.com/tiptech.html

Or, a worksheet_double click event to goto the sheet where the name is in
a
cell. Make a list using a macro.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mark" wrote in message
...
Hello everyone,
I'm trying to create an input box that woulk ask for a worksheet name,
which
is one of a hundred worksheets. If the name is incorrect or a name is
not
given then a msg box would come up and repeat the request again. After
3
times a file will appear to assist the user. How can I resolve this.
Thanks.
--
Mark





Max

Input box data check
 
GetWorkbook ' calls another macro to do that
Could you kindly post the above sub?



Mark[_8_]

Input box data check
 
Hey Don,

Just got back from the holidays. I ran your routine and it works great,
thanks. Is there a book I could get to help me on VBA in Excel (one that has
lots of examples)?
Again thanks.
--
Mark


"Mark" wrote:

Hello everyone,
I'm trying to create an input box that woulk ask for a worksheet name, which
is one of a hundred worksheets. If the name is incorrect or a name is not
given then a msg box would come up and repeat the request again. After 3
times a file will appear to assist the user. How can I resolve this. Thanks.
--
Mark



All times are GMT +1. The time now is 08:18 PM.

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