Public Sub Sheet_Select(Sheet_Name As String, Dest As String, Del_Sheet As Boolean) ' This checks that a sheet exists and then switches to it positioning into the specified column and in the first empty cell. Dim flag As Boolean Dim ws As Worksheet Application.DisplayAlerts = False flag = "False" For Each ws In ActiveWorkbook.Sheets If ws.Name = Sheet_Name Then If Del_Sheet Then Sheets(Sheet_Name).Delete Else flag = "True" End If End If Next ws If Not flag Then Sheets.Add(After:=Sheets(Sheets.Count)).Name = Sheet_Name Sheets(Sheet_Name).Select Cells(Rows.Count, Dest).End(xlUp).Offset(Abs(Cells(Rows.Count, Dest).End(xlUp).Value <> ""), 0).Select Application.DisplayAlerts = True End Sub
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter