Saturday, January 9, 2021

Jump any sheet by coading

 'Program Created by Learn More Channel

Sub Enter_Sheet_Number()

Dim sheetnum As Integer
On Error GoTo ErrorMessage
sheetnum = InputBox("Enter Sheet No")
If sheetnum > Sheets.Count Then
MsgBox "Sheet Not Aviable"
Else
Sheets(sheetnum).Activate
End If
ErrorMessage:
If Err.Number = 13 Then
Err.Clear
MsgBox "Invlaid Sheet No"
End If

End Sub

Sub Enter_Sheet_Name()

Dim sheetname As String
sheetname = InputBox("Enter Sheet Name")
On Error GoTo ErrorMessage
Sheets(sheetname).Activate
ErrorMessage:
If Err.Number = 9 Then
Err.Clear
MsgBox "Invlaid Sheet Name"
End If

End Sub

No comments:

Post a Comment

THANKS FOR YOUR SUPPORT

Data copy paste on two another sheet with add row in google sheet by script

 function copyDataWithinWorkbook() {   var sourceSheetName = "Dashbord"; // Replace with the name of the source sheet   var target...