View difference between Paste ID: 1uZzWypT and EFy8Vyti
SHOW: | | - or go back to the newest paste.
1
'Трябва да ги сложи в ComboBox3 taka:
2-
ComboBox3.addItem "sk_materials"
2+
'ComboBox3.addItem "sk_materials"
3-
ComboBox3.addItem "sk_stocks"
3+
'ComboBox3.addItem "sk_stocks"
4-
......
4+
'......
5-
.....
5+
'.....
6
7
8-
Private Function CheckIfSheetExist(SheetName As String)
8+
Private Function addSkSheetsToComboBox3()
9
    Dim ws As Worksheet ', sheetName As String
10
    For Each ws In ThisWorkbook.Worksheets
11-
        If ws.Name = SheetName Then
11+
        'InStr(...) намира позицията, на която "sk_" присъства в името на шийта
12-
            CheckIfSheetExist = True
12+
        'Ако позицията е 1, значи иметп на шийта почва със "sk_"
13-
            Exit For
13+
        If InStr(1, ws.Name, "sk_") = 1 Then
14-
        Else
14+
            ComboBox3.addItem ws.Name
15-
            CheckIfSheetExist = False
15+
16
    Next ws
17
End Function