• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Série de faturas de tipo de movimento

mahmoudnasr2000

New Member
>>> use code - tags <<<
Code:
Sub Cod_Sereal_Number()
On Error Resume Next
Set ww = Application.WorksheetFunction
ThisWorkbook.Activate
Dim old_name, new_name
old_name = Me.ComboBox1.Value
new_name = Me.TextBox1.Value
 fda = ww.CountIf(Sheet2.Range("b2:b2000"), old_name)
If fda <= 0 Then: MsgBox "The invoice type is not found in the database. Please enter serial number ( 1 )"
': UserForm1.TextBox1 = 1
Dim ws2 As Worksheet
    Set ws2 = Sheets("Data")
    Dim lastrow As Long
    lastrow = ws2.Cells(ws2.Rows.Count, "a").End(xlUp).Row
    Dim i As Integer
    Dim foundValue As String
    TextBox1.Value = ""
    For i = 2 To lastrow
        If ws2.Cells(i, 2).Value = ComboBox1.Value Then
            foundValue = ws2.Cells(i, 1).Value
        End If
    Next i
    TextBox1.Value = foundValue + 1
    Exit Sub
    UserForm1.TextBox1 = 1
End Sub
 
Last edited by a moderator:
Bom dia
por favor me ajude
Há uma lista suspensa que contém transações com base no tipo de fatura, como desembolso/compra/venda/devolução/saldo do primeiro período/e saída.


Cada transação de fatura possui um código de série personalizado com base no tipo de fatura, mas no banco de dados não há nenhuma transação de fatura de saída. Quando desejo iniciar a primeira transação, o número de série do código da transação (1) é adicionado após a mensagem de consulta msgbox.
 

Attachments

  • Copy of Invoice series according to the type of invoice.xlsm
    36.5 KB · Views: 2
Movement type invoice series

Good morning
Please help me
There is a drop-down list that contains transactions based on the invoice type, such as disbursement/purchase/sale/return/first period balance/and outgoing.


Each invoice transaction has a custom serial code based on the invoice type, but there is no outgoing invoice transaction in the database. When I want to start the first transaction, the transaction code serial number (1) is added after the msgbox query message.
I want when the warning message appears, it will automatically
MsgBox "The invoice type is not found in the database. Please enter serial number ( 1 )"
add series number 1 in textbox1 automatically
 
Back
Top