bopo
05-21-2007, 05:19 PM
Hi
Well I have some coding which adds data to a sheet and starts a new line, the coding grabs data from textboxes within UserForm, and pastes them into specific columns which is great.
However two of the imports are not working, I think this is due to mutiple text boxes and define, rather than one source. Anyway if anyone thinks something looks wrong, feel free to post.
'########CODES1######
iLastRow = .Cells(.Rows.Count, "E").End(xlUp).Row + 1
.Range("E" & iLastRow).Value = (InvoiceForm.txtcode1.Text) & _
" " & (InvoiceForm.txtcode2.Text) & " " & (InvoiceForm.txtcode5.Text) & _
" " & (InvoiceForm.txtcode6.Text) & ""
'########CODES2######
iLastRow = .Cells(.Rows.Count, "F").End(xlUp).Row + 1
.Range("F" & iLastRow).Value = InvoiceForm.txt1.Text & _
" " & (InvoiceForm.txt2.Text) & " " & (InvoiceForm.txtcode7.Text) & _
" " & (InvoiceForm.txtcode8.Text) & ""
Edit: line breaks addes so code doesn't run off the screen
Well I have some coding which adds data to a sheet and starts a new line, the coding grabs data from textboxes within UserForm, and pastes them into specific columns which is great.
However two of the imports are not working, I think this is due to mutiple text boxes and define, rather than one source. Anyway if anyone thinks something looks wrong, feel free to post.
'########CODES1######
iLastRow = .Cells(.Rows.Count, "E").End(xlUp).Row + 1
.Range("E" & iLastRow).Value = (InvoiceForm.txtcode1.Text) & _
" " & (InvoiceForm.txtcode2.Text) & " " & (InvoiceForm.txtcode5.Text) & _
" " & (InvoiceForm.txtcode6.Text) & ""
'########CODES2######
iLastRow = .Cells(.Rows.Count, "F").End(xlUp).Row + 1
.Range("F" & iLastRow).Value = InvoiceForm.txt1.Text & _
" " & (InvoiceForm.txt2.Text) & " " & (InvoiceForm.txtcode7.Text) & _
" " & (InvoiceForm.txtcode8.Text) & ""
Edit: line breaks addes so code doesn't run off the screen