
Private Sub CommandButton1_Click()
Dim bln As Boolean
Dim lRiga As Long
Dim sh As Worksheet
Select Case Me.TextBox1.Text
Case Is = "ale1"
If Me.TextBox2.Text = "ale1" Then
bln = True
End If
Case Is = "ale2"
If Me.TextBox2.Text = "ale2" Then
bln = True
End If
Case Is = "ale3"
If Me.TextBox2.Text = "ale3" Then
bln = True
End If
Case Else
bln = False
End Select
If bln = True Then
With sh
frmGestioneDati.Show
End With
End If
End Sub |
Private Sub CommandButton1_Click()
Dim bln As Boolean
Dim lRiga As Long
Dim sh As Worksheet
Select Case Me.TextBox1.Text
Case Is = "ale1"
If Me.TextBox2.Text = "ale" Then
bln = True
ActiveCell.Value = Now() ' ho inserito questo codice che mi scrive la data ed orario
' Unico propblema al momento che lo fa sulla cella attiva.
End If
Case Is = "ale2"
If Me.TextBox2.Text = "ale" Then
bln = True
End If
Case Is = "ale3"
If Me.TextBox2.Text = "ale" Then
bln = True
End If
Case Else
bln = False
End Select
If bln = True Then
With sh
frmGestioneDati.Show
End With
End If
End Sub |
ultima_riga = sheets("accessi").cells([a:a].rows.count, 1).end(xlup).offset(1)
sheets("accessi").cells(ultima_riga, 1) = textbox1
sheets("accessi").cells(ultima_riga, 2) = formatdatetime(now, vbshortdate)
Private Sub CommandButton1_Click()
Dim bln As Boolean
Dim lRiga As Long
Dim sh As Worksheet
Select Case Me.TextBox1.Text
Case "ale1"
If Me.TextBox2.Text = "ale" Then
ThisWorkbook.Worksheets("Accessi").Visible = xlSheetVisible ' Ho inserito questo codice che mi seleziona il foglio
Range("B1").Value = Now() ' + questo di patel
bln = True ' Abbiamo ottenuto un risultato. Sarebbe che
End If ' mi inserisce la data e ora nel foglio specificato
Case Is = "ale2" ' alla cella B5
If Me.TextBox2.Text = "ale" Then
ThisWorkbook.Worksheets("Accessi").Visible = xlSheetVisible
Range("B5").Value = Now()
bln = True
End If
Case Is = "ale3"
If Me.TextBox2.Text = "ale" Then
ThisWorkbook.Worksheets("Accessi").Visible = xlSheetVisible
Range("B5").Value = Now()
bln = True
End If
Case Else
bln = False
End Select
If bln = True Then
With sh
frmGestioneDati.Show
End With
End If
End Sub |
Private Sub CommandButton1_Click()
Dim bln As Boolean
Dim lRiga As Long
Dim sh As Worksheet
Set sh = Sheets("Accessi")
lRiga = sh.Cells(Rows.Count, "A").End(xlUp).Row + 1 'prima riga libera
Select Case Me.TextBox1.Text
Case Is = "ale1"
If Me.TextBox2.Text = "ale" Then
bln = True
End If
Case Is = "ale2"
If Me.TextBox2.Text = "ale" Then
bln = True
End If
Case Is = "ale3"
If Me.TextBox2.Text = "ale" Then
bln = True
End If
Case Else
bln = False
End Select
If bln = True Then
sh.Cells(lRiga, 2) = Now()
sh.Cells(lRiga, 1 = Me.TextBox1.Text
frmGestioneDati.Show
End If
End Sub
|
Private Sub CommandButton1_Click()
Dim bln As Boolean
Dim lRiga As Long
Dim sh As Worksheet
Select Case Me.TextBox1.Text
Case "ale1"
ThisWorkbook.Worksheets("Accessi").Visible = xlSheetVisible
Range("A1").Value = TextBox1.Text ' Inserendo questo codice mi riporta anche il nome utente
If Me.TextBox2.Text = "ale" Then
ThisWorkbook.Worksheets("Accessi").Visible = xlSheetVisible ' Ho inserito questo codice che mi seleziona il foglio
Range("B1").Value = Now() ' + questo di patel
bln = True ' Abbiamo ottenuto un risultato. Sarebbe che
End If ' mi inserisce la data e ora nel foglio specificato
Case Is = "ale2" ' alla cella B5
If Me.TextBox2.Text = "ale" Then
ThisWorkbook.Worksheets("Accessi").Visible = xlSheetVisible
Range("B5").Value = Now()
bln = True
End If
Case Is = "ale3"
If Me.TextBox2.Text = "ale" Then
ThisWorkbook.Worksheets("Accessi").Visible = xlSheetVisible
Range("B5").Value = Now()
bln = True
End If
Case Else
bln = False
End Select
If bln = True Then
With sh
frmGestioneDati.Show
End With
End If
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub CommandButton3_Click()
Dim bln As Boolean
Dim lRiga As Long
Dim sh As Worksheet
Set sh = Sheets("Accessi")
lRiga = sh.Cells(Rows.Count, "A").End(xlUp).Row + 1 'prima riga libera
Select Case Me.TextBox1.Text
Case Is = "ale1"
If Me.TextBox2.Text = "ale" Then
bln = True
End If
Case Is = "ale2"
If Me.TextBox1.Text = "ale" Then
bln = True
End If
Case Is = "ale3"
If Me.TextBox2.Text = "ale" Then
bln = True
End If
Case Else
bln = False
End Select
If bln = True Then
sh.Cells(lRiga, 1) = Now()
sh.Cells(lRiga, 2 = Me.TextBox1.Text
frmGestioneDati.Show
End If
End Sub |
