Untitled

mail@pastecode.io avatar
unknown
vbscript
a month ago
619 B
2
Indexable
Never
Sub rolci()
    Dim ws As Worksheet
    Dim newSheet As Worksheet
    Dim i As Integer
    Dim letezik As Boolean
    letezik = False
    
    i = 1
    For Each ws In ThisWorkbook.Worksheets
        If ws.Name = "Nevek" Then
        letezik = True
        End If
        i = i + 1
    Next ws

    If letezik = False Then
        Set newSheet = Sheets.Add
        newSheet.Name = "Nevek"
    
        i = 1
        For Each ws In ThisWorkbook.Worksheets
            If ws.Name <> "Nevek" Then
            newSheet.Cells(i, 1).Value = ws.Name
            i = i + 1
            End If
        Next ws
    End If
End Sub
Leave a Comment