Hi, I have an excel table with 16 columns. I want to add another one and in the 17th I want to put a button named "edit" and assign to it the macro "macro1". To write in the excel table I use this code:
Code
RowCount = Worksheets("Soci").Range("A1").CurrentRegion.Rows.Count
With Worksheets("Soci").Range("A1")
.Offset(RowCount, 0).Value = Me.lblMatricola.Caption
.Offset(RowCount, 1).Value = Me.txtNome.Value
.Offset(RowCount, 2).Value = Me.txtCognome.Value
Select Case True
Case Me.optFemmina
.Offset(RowCount, 3).Value = "F"
Case Me.optMaschio
.Offset(RowCount, 3).Value = "M"
End Select
.Offset(RowCount, 4).Value = Me.txtAnnoIscrizione.Value
If Me.chkScheda.Value = True Then
.Offset(RowCount, 5).Value = "Si"
Else
.Offset(RowCount, 5).Value = "No"
End If
.Offset(RowCount, 6).Value = Me.cboTipoSocio.Value
If Me.chkCarri.Value = True Then
.Offset(RowCount, 7).Value = "Si"
Else
.Offset(RowCount, 7).Value = "No"
End If
.Offset(RowCount, 8).Value = Me.txtIndirizzo.Value
.Offset(RowCount, 9).Value = Me.txtPaese.Value
.Offset(RowCount, 10).Value = DateValue(Me.txtDataNascita.Value)
.Offset(RowCount, 11).Value = Me.txtPaeseNascita.Value
If Me.txtCodiceFiscale1.Value = "" Then
.Offset(RowCount, 12).Value = Me.txtCodiceFiscale2.Value
Else
.Offset(RowCount, 12).Value = Me.txtCodiceFiscale1.Value
End If
.Offset(RowCount, 13).Value = Me.txtCellulare.Value
.Offset(RowCount, 14).Value = Me.txtEmail.Value
End With
Display More
So every time I write a new row to the excel table I add even a button. Is there a way?
Thanks