Skip to main content

AccessTr.neT


Excel Userformda Vba İle Günün Tarihinden Sipariş Numarası Oluşturma

Oğuz Türkyılmaz
Oğuz Türkyılmaz
24
2005

Excel Userformda Vba İle Günün Tarihinden Sipariş Numarası Oluşturma

#24
ilgili kodu alttaki gibi değiştirin abey önceki kodda bul diye kod yazmıştım gereksiz olmuş zayen countif ile şart aranıyor.

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
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
RE: Excel Userformda Vba İle Günün Tarihinden Sipariş Numarası Oluşturma - Yazar: feraz - 21/03/2021, 23:16
Task