gecf343b1
asked on
Reset workbook to include the text "Tail #" in cell A! on all sheets
Hello Experts
I am using the following macro to set up a worksheet based of an model input and input a actual tail #. I was wondering if the resetsheets sub could be amended to place the following text on cell A1 "Tail #" Thanks
Sub SelectModel()
Dim strSheet As String, strTail
Dim wksKeep As Worksheet, wks As Worksheet
Do
strSheet = InputBox("Enter an Aircraft Model to use: 135KL, 145LR, or 145LR NO ROW 13", "Select Aircraft Model")
If strSheet = "" Then
Exit Sub
Else
On Error Resume Next
Set wksKeep = Sheets(strSheet)
On Error GoTo 0
If wksKeep Is Nothing Then
MsgBox "Invalid name - please try again (Check spelling)"
End If
End If
Loop While wksKeep Is Nothing
Application.DisplayAlerts = False
For Each wks In ThisWorkbook.Worksheets
If wks.Name <> wksKeep.Name Then wks.Visible = xlSheetHidden
Next wks
Application.DisplayAlerts = True
strTail = InputBox("Enter a TAil Tumber")
wksKeep.Range("A1").Value = strTail
End Sub
Sub resetsheets()
Dim wks As Worksheet
For Each wks In ThisWorkbook.Worksheets
wks.Visible = xlSheetVisible
Next wks
End Sub
I am using the following macro to set up a worksheet based of an model input and input a actual tail #. I was wondering if the resetsheets sub could be amended to place the following text on cell A1 "Tail #" Thanks
Sub SelectModel()
Dim strSheet As String, strTail
Dim wksKeep As Worksheet, wks As Worksheet
Do
strSheet = InputBox("Enter an Aircraft Model to use: 135KL, 145LR, or 145LR NO ROW 13", "Select Aircraft Model")
If strSheet = "" Then
Exit Sub
Else
On Error Resume Next
Set wksKeep = Sheets(strSheet)
On Error GoTo 0
If wksKeep Is Nothing Then
MsgBox "Invalid name - please try again (Check spelling)"
End If
End If
Loop While wksKeep Is Nothing
Application.DisplayAlerts = False
For Each wks In ThisWorkbook.Worksheets
If wks.Name <> wksKeep.Name Then wks.Visible = xlSheetHidden
Next wks
Application.DisplayAlerts = True
strTail = InputBox("Enter a TAil Tumber")
wksKeep.Range("A1").Value = strTail
End Sub
Sub resetsheets()
Dim wks As Worksheet
For Each wks In ThisWorkbook.Worksheets
wks.Visible = xlSheetVisible
Next wks
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Change this line
wksKeep.Range("A1").Value = strTail
to
wksKeep.Range("A1").Value = "Tail # " & strTail
wksKeep.Range("A1").Value = strTail
to
wksKeep.Range("A1").Value = "Tail # " & strTail
ASKER
Thanks
You are welcome :)
Sid
Sid
Open in new window
Sid