Sub siparisKod()
Dim txt As String
Dim say As Long, txt2 As String, x As String
txt = Format(Date, "ddmmyyyy")
txt2 = "SP-" & txt
With ThisWorkbook.Worksheets("ORDER_LIST")
say = WorksheetFunction.CountIf(.Range("H:H"), txt2 & "*")
Select Case Len(say)
Case 1 To 9: x = "00"
End Select
If say > 0 Then
TextBox_SiparisKodu.Value = txt2 & Format(say + 1, x)
Else
TextBox_SiparisKodu.Value = txt2 & "01"
End If
End With
End Sub
ilgili kodu alttaki gibi değiştirin abey önceki kodda bul diye kod yazmıştım gereksiz olmuş zayen countif ile şart aranıyor.