Click here to Skip to main content
15,906,816 members

Comments by miguel santos 2021 (Top 31 by date)

miguel santos 2021 18-Sep-23 9:13am View    
Rows = Sheets("student_list").Range("A1048576").End(x1UP).Row + 1
With ThisWorkbook.Sheets("student_list")
give the error Rows=0 s

I apologize for my English
miguel santos 2021 18-Sep-23 8:39am View    
Quando eu executo o código, dá o erro:
Sub, Função ou Propriedade não definida.
não sei se srá de você meu excell estar em português e a semântica é diferente,
worksheet= Folha
ThisWorkSheet = EsteLivro etc, como disse estou a me inciar em vba.
Muito obrigado
miguel santos 2021 18-Sep-23 6:20am View    
rivate Sub btnSubmit_Click()

Application.ScreenUpdating = False

Dim Rows As Long
'data base table name and range
Rows = Folha("student_list").Range("A1048576").End(x1UP).Row + 1
'data base table name and total range

With EsteLivro.Folhas("student_list")
'insert fields

.Range("A" & Rows).Value = Rows + 9999 'this row will genetate and insert serial number
.Range("B" & Rows).Value = txtfirstname.Value
.Range("C" & Rows).Value = txtlastname.Value
.Range("D" & Rows).Value = txtemail.Value
.Range("E" & Rows).Value = txtphone.Value
.Range("F" & Rows).Value = cmbgender.Text
.Range("G" & Rows).Value = cmblevel.Text
.Range("H" & Rows).Value = cmbcountry.Text
.Range("I" & Rows).Value = cmbcity.Text
.Range("J" & Rows).Value = txtaddress.Value
.Range("K" & Rows).Value = txtcurrent_address.Value

Unload UserForm2

Application.ScreenUpdating = True
End With

End Sub
miguel santos 2021 18-Sep-23 6:19am View    
Private Sub btnSubmit_Click()

Application.ScreenUpdating = False

Dim Rows As Long
'data base table name and range
Rows = Folha("student_list").Range("A1048576").End(x1UP).Row + 1
'data base table name and total range

With EsteLivro.Folhas("student_list")
'insert fields

.Range("A" & Rows).Value = Rows + 9999 'this row will genetate and insert serial number
.Range("B" & Rows).Value = txtfirstname.Value
.Range("C" & Rows).Value = txtlastname.Value
.Range("D" & Rows).Value = txtemail.Value
.Range("E" & Rows).Value = txtphone.Value
.Range("F" & Rows).Value = cmbgender.Text
.Range("G" & Rows).Value = cmblevel.Text
.Range("H" & Rows).Value = cmbcountry.Text
.Range("I" & Rows).Value = cmbcity.Text
.Range("J" & Rows).Value = txtaddress.Value
.Range("K" & Rows).Value = txtcurrent_address.Value

Unload UserForm2

Application.ScreenUpdating = True
End With

End Sub
miguel santos 2021 21-Jul-22 4:55am View    
thanks again.
I asked this question because I'm new to sql.
And in a previous topic, I asked for help to create a field calculated with subtraction in a view.
As they couldn't help me, I thought of using view to create and update a table, and make the calculated field in that table