'**************************************************
'Codice Inserimento dati da ComBox-TexBox-CheckBox'
'**************************************************
Private Sub archivia_Click()
Sheets("GiornaleLavori").Unprotect Password:="123"
Dim RowCount As Long
Dim ctl As Control
RowCount = Worksheets("GiornaleLavori").Range("B1").CurrentRegion.Rows.Count
With Worksheets("GiornaleLavori").Range("B1")
.Offset(RowCount, 0).Value = ordine.Value
.Offset(RowCount, 1).Value = CDate(data.Value)
.Offset(RowCount, 2).Value = Meteo.Value
.Offset(RowCount, 3).Value = cantiere.Value
.Offset(RowCount, 4).Value = ComboBox5.Value
.Offset(RowCount, 5).Value = ComboBox1.Value
.Offset(RowCount, 6).Value = Opera.Value
.Offset(RowCount, 7).Value = WBS.Value
.Offset(RowCount, 8).Value = Sub_wbs.Value
.Offset(RowCount, 9).Value = Task_Lavorazioni1.Value
.Offset(RowCount, 10).Value = Attivita1.Value
.Offset(RowCount, 11).Value = ore_Lav1.Value
.Offset(RowCount, 12).Value = Trasf.Value
.Offset(RowCount, 13).Value = ore_perm.Value
.Offset(RowCount, 14).Value = ore_inte.Value
.Offset(RowCount, 15).Value = Ferie.Value
.Offset(RowCount, 16).Value = ComboBox2.Value
.Offset(RowCount, 17).Value = Matricola1.Value
.Offset(RowCount, 18).Value = ore1.Value
.Offset(RowCount, 19).Value = Attrez1.Value
.Offset(RowCount, 20).Value = ComboBox4.Value
.Offset(RowCount, 21).Value = Matricolattrez.Value
.Offset(RowCount, 22).Value = oreattrez.Value
.Offset(RowCount, 23).Value = Materiale.Value
.Offset(RowCount, 24).Value = viaggi.Value
.Offset(RowCount, 25).Value = mc_ton.Value
.Offset(RowCount, 26).Value = Note.Value
End With
Opera.Text = ""
WBS.Text = ""
Sub_wbs.Text = ""
Task_Lavorazioni1.Text = ""
Attivita1.Text = ""
ore_Lav1.Text = ""
ore_perm.Text = ""
ore_inte.Text = ""
Ferie.Text = ""
Matricola1.Text = ""
ore1.Text = ""
Attrez1.Text = ""
ComboBox4.Text = ""
Matricolattrez.Text = ""
oreattrez.Text = ""
Materiale.Text = ""
viaggi.Text = ""
mc_ton.Text = ""
Note.Text = ""
ComboBox2 = ""
Trasf = ""
ComboBox2.SetFocus
'*******************************************
'Inseriemnto in automatico N° di ordine (2)'
'*******************************************
Range("B11").Select
While ActiveCell <> ""
If ActiveCell <> "N° ord" Then
ordine.Text = ActiveCell.Offset(0, 0).Value + 1
Else
'ordine: Text = 1
End If
ActiveCell.Offset(1, 0).Activate
Wend
'********************************************************************************
'Codice per aggiornare i dati nella listbox dopo varie modifiche o registrazione
'********************************************************************************
CaricaDati
Sheets("GiornaleLavori").Protect Password:="123"
End Sub
|