Mabangiz32
New Member
- Joined
- Mar 28, 2018
- Messages
- 4
this is from the macro that i am using for optimization.
need help because when i start the macro it would count 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12 and so on.
i cannot find out how number 10 is not showing,
thanks for the help.
*macro
'Stampanje oznake sipke npr.A, B, C...itd.
slova = "123456789"
Range("f14").Value = "Bar"
Dim rowCnt As Integer, cntLevel1 As Integer, cntLevel2 As Integer
rowCnt = 0
cntLevel1 = -1
cntLevel2 = -1
Dim id As String
For i = 0 To komada - 1
id = ""
If cntLevel2 > -1 Then id = id + Mid(slova, cntLevel2 + 1, 1)
If cntLevel1 > -1 Then id = id + Mid(slova, cntLevel1 + 1, 1)
ActiveCell.Offset(i, 4).Value = id + Mid(slova, rowCnt + 1, 1)
rowCnt = rowCnt + 1
If rowCnt >= 10 Then
cntLevel1 = cntLevel1 + 1
rowCnt = 0
If cntLevel1 >= 10 Then
cntLevel2 = cntLevel2 + 1
cntLevel1 = 0
End If
End If
Next i
thanks for the help..
need help because when i start the macro it would count 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12 and so on.
i cannot find out how number 10 is not showing,
thanks for the help.
*macro
'Stampanje oznake sipke npr.A, B, C...itd.
slova = "123456789"
Range("f14").Value = "Bar"
Dim rowCnt As Integer, cntLevel1 As Integer, cntLevel2 As Integer
rowCnt = 0
cntLevel1 = -1
cntLevel2 = -1
Dim id As String
For i = 0 To komada - 1
id = ""
If cntLevel2 > -1 Then id = id + Mid(slova, cntLevel2 + 1, 1)
If cntLevel1 > -1 Then id = id + Mid(slova, cntLevel1 + 1, 1)
ActiveCell.Offset(i, 4).Value = id + Mid(slova, rowCnt + 1, 1)
rowCnt = rowCnt + 1
If rowCnt >= 10 Then
cntLevel1 = cntLevel1 + 1
rowCnt = 0
If cntLevel1 >= 10 Then
cntLevel2 = cntLevel2 + 1
cntLevel1 = 0
End If
End If
Next i
thanks for the help..