Hello,
Could anyone please help me with my code? I don't know what I'm doing wrong, it works perfectly on one file (Remision), but for some reason it won't work on the other one (CI Fill).
It is a simple userform that helps creating some documents. I attach them for your reference.
What the code does:
It's a userform that fills some basic information on the document, then it uses a second part of the userform to fill down information on a row by row basis. You fill the info, click the button and it fills row 1, click it again and it fills row 2, etc.
This is the code that won't work on the CI Fill file:
Here are the files:
https://www.dropbox.com/s/rqoxyeh17wvwwi8/Remision.xlsm?dl=0
https://www.dropbox.com/s/djz2xabnla5rue0/CI Fill.xlsm?dl=0
Regards,
David
Could anyone please help me with my code? I don't know what I'm doing wrong, it works perfectly on one file (Remision), but for some reason it won't work on the other one (CI Fill).
It is a simple userform that helps creating some documents. I attach them for your reference.
What the code does:
It's a userform that fills some basic information on the document, then it uses a second part of the userform to fill down information on a row by row basis. You fill the info, click the button and it fills row 1, click it again and it fills row 2, etc.
This is the code that won't work on the CI Fill file:
Code:
Private Sub Cmd2_Click()
Dim LastRow As Long, ws As Worksheet
Set ws = Sheets("Factura")
LastRow = ws.Range("A46").End(xlUp).Row + 1 'Finds the last blank row
ws.Range("A" & LastRow).Value = PosTxt.Text 'Línea
ws.Range("A" & LastRow).Offset(0, 1).Value = TextBox7.Value 'Cantidad
ws.Range("A" & LastRow).Offset(0, 2).Value = TextBox9.Value 'Descripción
ws.Range("A" & LastRow).Offset(0, 3).Value = TxtSerial.Value 'Seriales
ws.Range("A" & LastRow).Offset(0, 4).Value = TextBox8.Value 'Precio Unitario
PosTxt.Value = PosTxt + 1
TextBox7.SetFocus
https://www.dropbox.com/s/rqoxyeh17wvwwi8/Remision.xlsm?dl=0
https://www.dropbox.com/s/djz2xabnla5rue0/CI Fill.xlsm?dl=0
Regards,
David