DTPicker



  • DTPicker
    di trump61 data: 07/11/2013 15:56:25

    Ciao a tutti, vi rompo ancora le scatole perchè devo modificare tutti i file che usavamo fino a qualche giorno fa. Su questo file ho creato una maschera per inserire dati su un foglio che funziona da database. per inserire la data utilizzavo l'oggetto DTPicker, adesso che lo apro con una nuova versione di excell mi dice che non è presente nel mio computer. l'ho cercato nella finestra aggiungi oggetti ma non c'è. Qualcuno sa se si puo' mettere in qualche modo, altrimenti devo cambiare la maschera e il codice grazie.
    Questo è il codice associato ad un commandbutton, dovrò mettere una textbox al posto del DTPicker, però mi piaceva più graficamente prima
     
    Private Sub CommandButton1_Click()
    Application.ScreenUpdating = False
    x = ComboBox1
    If ComboBox1.Text = "Foglio Base" Or ComboBox1.Text = "" Then
    MsgBox "Seleziona L'Agente interessato"
    Exit Sub
    End If
    'sotto: controlliamo con un ciclo For Next che le 4 textbox non siano vuote, altrimenti usciamo avvisando
    For I = 1 To 3
    If UserForm1.Controls("TextBox" & I).Text = "" Then
    MsgBox "MANCANO DATI"
    Exit Sub
    End If
    Next
    R = Sheets(x).Range("A" & Rows.Count).End(xlUp).Row + 1
    Sheets(x).Cells(R, 1) = TextBox1.Value
    Sheets(x).Cells(R, 2) = DTPicker1
    Sheets(x).Cells(R, 3) = TextBox2.Value
    Sheets(x).Cells(R, 4) = TextBox3.Value
    Dim sh As String
    sh = ComboBox1
    Worksheets(sh).Select
    TextBox4 = 1
    TextBox5 = 2
    TextBox6 = 3
    TextBox7 = 4
    TextBox8 = 5
    Label32.Visible = True
    Label34.Visible = True
    Label35.Visible = True
    Label33.Visible = True
    Label36.Visible = True
    TextBox10.Visible = True
    TextBox11.Visible = True
    TextBox12.Visible = True
    TextBox13.Visible = True
    TextBox14.Visible = True
    CommandButton2.Visible = False
    Dim myRange, tuoRange As Range
    x = TextBox4
    Set myRange = Range("C2:C200")
    Set tuoRange = Range("A2:A200")
    TextBox10 = WorksheetFunction.SumIf(tuoRange, x, myRange)
    y = TextBox5
    Set myRange = Range("C2:C200")
    Set tuoRange = Range("A2:A200")
    TextBox11 = WorksheetFunction.SumIf(tuoRange, y, myRange)
    R = TextBox6
    Set myRange = Range("C2:C200")
    Set tuoRange = Range("A2:A200")
    TextBox12 = WorksheetFunction.SumIf(tuoRange, R, myRange)
    M = TextBox7
    Set myRange = Range("C2:C200")
    Set tuoRange = Range("A2:A200")
    TextBox13 = WorksheetFunction.SumIf(tuoRange, M, myRange)
    n = TextBox8
    Set myRange = Range("C2:C200")
    Set tuoRange = Range("A2:A200")
    TextBox14 = WorksheetFunction.SumIf(tuoRange, n, myRange)
    Label28.Visible = True
    TextBox9.Visible = True
    CommandButton5.Visible = True
    Dim mr As Range
    Set mr = Range("C1:C200")
    TextBox9 = WorksheetFunction.Sum(mr)
    Application.ScreenUpdating = True
    End Sub