Creare una Calcolatrice con Excel



  • Creare una Calcolatrice con Excel
    di Maurizio (utente non iscritto) data: 09/10/2014 13:55:39

    Buon Giorno mi chiamo Maurizio ho un problema che vorrei riuscire a risolve con Excel , il problema e Questo :
    Tempo fà mi ero costruito una calcolatrice più o meno Scentifica sfuttando un Userform , e questa devo dire che funziona benissimo .
    Ora però mi e venuta la bella Idea di Voler ritrascrivere la Stessa cosa , solo usando però un Foglio di Excel.
    Mi spiego meglio : mentre nel userform usavo dei tasti per comporre i numeri eccetera ; Sul Foglio uso soltanto le Celle come tastiera ; Detto questo devo dire che il tutto mi funziona anche abbastanza be , se non per il fatto ; e qui stà il mio problema , che ogni qual volta che premo la Cella Corrispondente al numero 1 sul mio Displai me lo conteggia come 11 e non come il solo Numero 1 Idem per il Numero 2 che viene riconosciuto come Numero 22 ecc....!
    Ora vorrei sapere perchè mi succede tutto ciò ! e come Posso fare per migliorare il Tutto ?
    Questo e il Mio Listato :

    Premetto che sè Volesse Aiutarmi in merito a questo mio problema Faccia pure con Calma si Prenda pure tutto il Tempo che vuole Io non ho fretta , per il resto le porgo i miei più sinceri saluti da A.Maurizio

    (P.s) Comunque sia ci Conosciamo già almeno Virtualmente per il Gioco da lei Creato pel famoso peg Solitaire .
     
    'Option Explicit
    '##################################
    Dim I As Integer
    Dim K As Integer
    Dim Tx As Integer
    Dim Ty As Integer
    '##################################
    Dim F As Byte
    Dim Y As Byte
    Dim OP As Boolean
    Dim Zona
    Dim Vcell
    Dim Numeratore(1 To 6) As Long
    Dim S As Integer
    Dim Temporaneo As String
    Dim Temp As Single
    Dim lunghezza As Byte
    Dim Divisione As Boolean
    Dim Adizione As Boolean
    Dim Sottrazione As Boolean
    Dim Moltiplicazione As Boolean
    Dim Punto As Boolean
    Dim Memoria As Single
    Dim Somma As Single
    '###################################
    Dim Keuro As Boolean
    Dim KLire As Boolean
    Dim FileName As String
    Dim KPercent As String
    Dim Target(1 To 25) As Range
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    On Error Resume Next
    'Routine che serve Per dare La Possibilità al Giocatore di _
    Selezionare i Numeri che Formeranno la Calcolatrice per lo _
    Svolgimento del Gioco Usando semplicemente il Mouse
    Application.Calculate
      'Application.Volatile
    
    Set Zona = Range("C5:G9")
      If Not Intersect(Target, Zona) Is Nothing Then
        Vcell = Target.Value
          Target.Interior.ColorIndex = 6
            If Range("B1") <> "" Then
              Range("B1").End(xlToLeft).Offset(0, 1).Value = Vcell '.Select
                Else
                  Range("A1").Value = Vcell
                    End If
                      Cells(0, 1).Select
                        End If
    
    If Not (Target = "C5" Or Target = "D5" Or Target = "E5" _
         Or Target = "C6" Or Target = "D6" Or Target = "E6" _
         Or Target = "C7" Or Target = "D7" Or Target = "E7" _
         Or Target = "D8" Or Target = "F5" Or Target = "F6" _
         Or Target = "F7" Or Target = "F8" Or Target = "F9" _
         Or Target = "C9" Or Target = "D9" Or Target = "E9" _
         Or Target = "G5" Or Target = "G6" Or Target = "G7" _
         Or Target = "G8" Or Target = "G9" Or Target = "C8" _
         Or Target = "E8") Then
         
    Range("A1").Value = Foglio1.Schermo.Text
    
    Select Case Target
    
    Case 0
    If Foglio1.Schermo.Text & Str("0") Then
    Zero_Click
    End If
    
    Case 1
    If Foglio1.Schermo.Text & Str("1") Then
    Uno_Click
    End If
    
    Case Is = "2"
    If Foglio1.Schermo.Text & "2" Then
    Due_Click
    End If
    
    Case 3
    If Foglio1.Schermo.Text & "3" Then
    Tre_Click
    End If
    
    Case 4
    If Foglio1.Schermo.Text & "4" Then
    Quattro_Click
    End If
    
    Case 5
    If Foglio1.Schermo.Text & "5" Then
    Cinque_Click
    End If
    
    Case 6
    If Foglio1.Schermo.Text & "6" Then
    Sei_Click
    End If
    
    Case 7
    If Foglio1.Schermo.Text & "7" Then
    Sette_Click
    End If
    
    Case 8
    If Foglio1.Schermo.Text & "8" Then
    Otto_Click
    End If
    
    Case 9
    If Foglio1.Schermo.Text & "9" Then
    Nove_Click
    End If
    
    Case Is = "+"
    If Foglio1.Schermo.Text & ("+") Then
    Piu_Click
    End If
    
    Case Is = "-"
    If Foglio1.Schermo.Text & ("-") Then
    Meno_Click
    End If
    
    Case Is = "*"
    If Foglio1.Schermo.Text & ("*") Then
    Per_Click
    End If
    
    Case Is = "/"
    If Foglio1.Schermo.Text & ("/") Then
    Diviso_Click
    End If
    
    Case Is = "%"
    If Foglio1.Schermo.Text & ("%") Then
    Percentuale_Click
    End If
    
    Case Is = "£"
    If Foglio1.Schermo.Text & ("£") Then
    Lira_Click
    End If
    
    Case Is = "€"
    If Foglio1.Schermo.Text & ("€") Then
    Euro_Click
    End If
    
    Case Is = "^"
    If Foglio1.Schermo.Text & ("^") Then
    ElevatoPotenza_Click
    End If
    
    Case Is = "C"
    If Foglio1.Schermo.Text & ("C") Then
    Cancella_Click
    End If
    
    Case Is = "Return"
    If Foglio1.Schermo.Text & ("Return") Then
    Rientro_Click
    End If
    
    Case Is = "Copy"
    If Foglio1.Schermo.Text & ("Copy") Then
    Memorizza_Click
    End If
    
    Case Is = "Reset"
    If Foglio1.Schermo.Text & ("Reset") Then
    Stampa_Click
    End If
    
    Case Is = "SQR"
    If Foglio1.Schermo.Text & ("SQR") Then
    RadiceQuadrata_Click
    End If
    
    Case Is = "."
    If Foglio1.Schermo.Text & (".") Then
    Virgola_Click
    End If
    
    Case Is = "="
    If Foglio1.Schermo.Text & ("=") Then
    Uguale_Click
    End If
    
    End Select
    End If
    Foglio1.Schermo.Activate
    Range("A1").Select
    End Sub
    
    Sub Cancella_Click()
    'On Error Resume Next
    Frm_CancellaDati.Show
      Temp = 0
    Moltiplicazione = False
      Adizione = False
    Divisione = False
      Sottrazione = False
    OP = False
    Foglio1.Schermo.Text = ""
    Foglio1.Range("A1").Value = ""
    Foglio1.Range("C4").Value = ""
    Range("A1").Select
    End Sub
    
    Sub Chiudi_Click()
    'On Error Resume Next
    Unload Me
    End Sub
    
    Sub Cinque_Click()
    'On Error Resume Next
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = "5"
        Else
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "5"
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Diviso_Click()
    'On Error Resume Next
    If Divisione = True Then
        If CDbl(Foglio1.Schermo.Text) > 0 Then
            Somma = Temp / CDbl(Foglio1.Schermo.Text)
            Foglio1.Schermo.Text = CStr(Somma)
        Else
            MsgBox "Impossibile dividere per 0", vbCritical, "Errore"
        End If
        Divisione = False
        OP = False
    End If
    If Adizione = True Then
        Somma = CDbl(Foglio1.Schermo.Text) + Temp
        Foglio1.Schermo.Text = CStr(Somma)
        Adizione = False
        OP = False
    End If
    If Sottrazione = True Then
        Somma = Temp - CDbl(Foglio1.Schermo.Text)
        Foglio1.Schermo.Text = CStr(Somma)
        Sottrazione = OP = False
    End If
    If Moltiplicazione = True Then
        Somma = CDbl(Foglio1.Schermo.Text) * Temp
        Foglio1.Schermo.Text = CStr(Somma)
        Moltiplicazione = False
        OP = False
    End If
    Temp = CDbl(Schermo.Text)
    Divisione = True
    OP = True
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Due_Click()
    'On Error Resume Next
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = "2"
        Else
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "2"
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.Activate
    End Sub
    
    Sub ElevatoPotenza_Click()
    'On Error Resume Next
    If Foglio1.Schermo.Text <> "" Then
    Foglio1.Schermo.Text = q(CDbl(Foglio1.Schermo.Text))
    End If
    End Sub
    
    Sub Euro_Click()
    'On Error Resume Next
    Const Keuro = 1936.27
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = Format(Foglio1.Schermo / Keuro, "#.##0,00")
        Else
            Foglio1.Schermo.Text = Format(Foglio1.Schermo / Keuro, "#.##0,00")
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Frame1_Click()
    
    End Sub
    
    Sub Lira_Click()
    'On Error Resume Next
    Const KLire = 1936.27
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = Format(Foglio1.Schermo * KLire, "0,00")
        Else
            Foglio1.Schermo.Text = Format(Foglio1.Schermo * KLire, "0,00")
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Memorizza_Click()
    On Error Resume Next
    Trasferimento_Dati_Click
    End Sub
    
    Sub Meno_Click()
    'On Error Resume Next
    If Divisione = True Then
        If CDbl(Foglio1.Schermo.Text) > 0 Then
            Somma = Temp / CDbl(Foglio1.Schermo.Text)
            Foglio1.Schermo.Text = CStr(Somma)
        Else
            MsgBox "Impossibile dividere per 0", vbCritical, "Errore"
        End If
        Divisione = False
        OP = False
    End If
    If Adizione = True Then
        Somma = CDbl(Foglio1.Schermo.Text) + Temp
        Foglio1.Schermo.Text = CStr(Somma)
        Adizione = False
        OP = False
    End If
    If Sottrazione = True Then
        Somma = Temp - CDbl(Foglio1.Schermo.Text)
        Foglio1.Schermo.Text = CStr(Somma)
        Sottrazione = OP = False
    End If
    If Moltiplicazione = True Then
        Somma = CDbl(Foglio1.Schermo.Text) * Temp
        Foglio1.Schermo.Text = CStr(Somma)
        Moltiplicazione = False
        OP = False
    End If
    Temp = CDbl(Foglio1.Schermo.Text)
    Sottrazione = True
    OP = True
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Nove_Click()
    'On Error Resume Next
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = "9"
        Else
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "9"
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Otto_Click()
    'On Error Resume Next
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = "8"
        Else
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "8"
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Per_Click()
    'On Error Resume Next
    If Divisione = True Then
        If CDbl(Foglio1.Schermo.Text) > 0 Then
            Somma = Temp / CDbl(Foglio1.Schermo.Text)
            Foglio1.Schermo.Text = CStr(Somma)
        Else
            MsgBox "Impossibile dividere per 0", vbCritical, "Errore"
        End If
        Divisione = False
        OP = False
    End If
    If Adizione = True Then
        Somma = CDbl(Foglio1.Schermo.Text) + Temp
       Foglio1.Schermo.Text = CStr(Somma)
        Adizione = False
        OP = False
    End If
    If Sottrazione = True Then
        Somma = Temp - CDbl(Foglio1.Schermo.Text)
        Foglio1.Schermo.Text = CStr(Somma)
        Sottrazione = OP = False
    End If
    If Moltiplicazione = True Then
        Somma = CDbl(Foglio1.Schermo.Text) * Temp
        Foglio1.Schermo.Text = CStr(Somma)
        Moltiplicazione = False
        OP = False
    End If
    Temp = CDbl(Foglio1.Schermo.Text)
    Moltiplicazione = True
    OP = True
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Percentuale_Click()
    'On Error Resume Next
      Const KPercent = 100
    '#######################################################
    If Percentuale = True Then
      Somma = CDbl(Foglio1.Schermo.Text) * Temp
    Foglio1.Schermo.Text = CStr(Somma)
      Percentuale = False
    OP = False
      End If
    '#######################################################
    Foglio1.Schermo.Text = Format(Somma / KPercent, "0.#,0")
      Foglio1.Schermo.SetFocus
    End Sub
    
    Private Sub Picture1_DblClick()
    'On Error Resume Next
    tmHor.Enabled = True
    End Sub
    
    Sub Piu_Click()
    'On Error Resume Next
    If Divisione = True Then
        If CDbl(Foglio1.Schermo.Text) > 0 Then
            Somma = Temp / CDbl(Foglio1.Schermo.Text)
            Foglio1.Schermo.Text = CStr(Somma)
        Else
            MsgBox "Impossibile dividere per 0", vbCritical, "Errore"
        End If
        Divisione = False
        OP = False
    End If
    If Adizione = True Then
        Somma = CDbl(Foglio1.Schermo.Text) + Temp
        Foglio1.Schermo.Text = CStr(Somma)
        Adizione = False
        OP = False
    End If
    If Sottrazione = True Then
        Somma = Temp - CDbl(Foglio1.Schermo.Text)
        Foglio1.Schermo.Text = CStr(Somma)
        Sottrazione = OP = False
    End If
    If Moltiplicazione = True Then
       Somma = CDbl(Foglio1.Schermo.Text) * Temp
        Foglio1.Schermo.Text = CStr(Somma)
        Moltiplicazione = False
        OP = False
    End If
    Temp = CDbl(Foglio1.Schermo.Text)
    Adizione = True
    OP = True
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Quattro_Click()
    'On Error Resume Next
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = "4"
        Else
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "4"
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub RadiceQuadrata_Click()
    'On Error Resume Next
    Foglio1.Schermo.Text = Sqr(CDbl(Foglio1.Schermo.Text))
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Rientro_Click()
    'On Error Resume Next
    If Foglio1.Schermo.Text <> "" And Foglio1.Schermo.Text <> "0" Then
        Temporaneo = Foglio1.Schermo.Text
        Foglio1.Schermo.Text = ""
        lunghezza = Len(Temporaneo)
        For F = 1 To lunghezza - 1 Step 1
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & Mid(Temporaneo, F, 1)
        Next F
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Private Sub Schermo_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
    'On Error Resume Next
    'Codice di Controllo che Indica Al Programma Quale tasto si e' Premuto il Quel Momento
    Select Case Chr(KeyAscii)
    Case "+"
      Piu_Click
    '''''''''''''''''''''''''''''
    Case "*"
      Per_Click
    '''''''''''''''''''''''''''''
    Case "/"
      Diviso_Click
    '''''''''''''''''''''''''''''
    Case "-"
      Meno_Click
    '''''''''''''''''''''''''''''
    Case ","
     Virgola_Click
    '''''''''''''''''''''''''''''
    Case "."
      Virgola_Click
    '''''''''''''''''''''''''''''
    Case "0"
      Zero_Click
    '''''''''''''''''''''''''''''
    Case "1"
      Uno_Click
    '''''''''''''''''''''''''''''
    Case "2"
      Due_Click
    '''''''''''''''''''''''''''''
    Case "3"
      Tre_Click
    '''''''''''''''''''''''''''''
    Case "4"
      Quattro_Click
    '''''''''''''''''''''''''''''
    Case "5"
      Cinque_Click
    '''''''''''''''''''''''''''''
    Case "6"
      Sei_Click
    '''''''''''''''''''''''''''''
    Case "7"
      Sette_Click
    '''''''''''''''''''''''''''''
    Case "8"
      Otto_Click
    '''''''''''''''''''''''''''''
    Case "9"
      Nove_Click
    '''''''''''''''''''''''''''''
    Case "10"
      ElevatoPotenza_Click
    ''''''''''''''''''''''''''''''
    Case "11"
      RadiceQuadrata_Click
    ''''''''''''''''''''''''''''''
    Case "12"
      Percentuale_Click
    ''''''''''''''''''''''''''''''
    Case "13"
      Rientro_Click
    ''''''''''''''''''''''''''''''
    Case "14"
      Memorizza_Click
    ''''''''''''''''''''''''''''''
    Case "15"
      Chiudi_Click
    ''''''''''''''''''''''''''''''
    Case "16"
      Cancella_Click
    ''''''''''''''''''''''''''''''
    Case "17"
      Memorizza_Click
    '##############################
    End Select
    If KeyAscii = 13 Then
        Uguale_Click
    End If
    KeyAscii = 0
    End Sub
    
    Sub Sei_Click()
    'On Error Resume Next
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = "6"
        Else
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "6"
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Sette_Click()
    'On Error Resume Next
    If OP = True Then
       Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = "7"
        Else
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "7"
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Stampa_Click()
    On Error Resume Next
    
    End Sub
    
    Sub Tre_Click()
    'On Error Resume Next
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = "3"
        Else
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "3"
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Uguale_Click()
    'On Error Resume Next
    If Divisione = True Then
        If CDbl(Foglio1.Schermo.Text) > 0 Then
           Somma = Temp / CDbl(Foglio1.Schermo.Text)
            Foglio1.Schermo.Text = CStr(Somma)
        Else
            MsgBox "Impossibile dividere per 0", vbCritical, "Errore"
        End If
        Divisione = False
        OP = False
    End If
    If Adizione = True Then
        Somma = CDbl(Foglio1.Schermo.Text) + Temp
        Foglio1.Schermo.Text = CStr(Somma)
        Adizione = False
        OP = False
    End If
    If Sottrazione = True Then
        Somma = Temp - CDbl(Foglio1.Schermo.Text)
        Foglio1.Schermo.Text = CStr(Somma)
        Sottrazione = OP = False
    End If
    If Moltiplicazione = True Then
        Somma = CDbl(Foglio1.Schermo.Text) * Temp
        Foglio1.Schermo.Text = CStr(Somma)
        Moltiplicazione = False
        OP = False
    End If
    'MacroNumeroCalcolato
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Uno_Click()
    On Error Resume Next
    If OP = True Then
        Foglio1.Schermo.Text = ""
    End If
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text = "0" Then
            Foglio1.Schermo.Text = "1"
        Else
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "1"
        End If
        OP = False
    Else
        Beep
    End If
    'Foglio1.Schermo.Activate
    Range("A1").Select
    End Sub
    
    Sub UserForm_activate()
    On Error Resume Next
    Me.Caption = " " & Time & "       " & Date
    End Sub
    
    Sub UserForm_Resize()
    On Error Resume Next
    Me.Height = 296.25
    Me.Width = 274.5
    End Sub
    
    Sub Virgola_Click()
    On Error Resume Next
    If lunghezza < 32 Then
        lunghezza = Len(Foglio1.Schermo.Text)
        For F = 1 To lunghezza Step 1
            If Mid(Foglio1.Schermo.Text, F, 1) = "," Then
                Virgola = True
            End If
        Next F
        If Virgola = False And Foglio1.Schermo.Text <> "" Then
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & ","
        Else
            If Foglio1.Schermo.Text = "" Then
                Foglio1.Schermo.Text = Foglio1.Schermo.Text & "0,"
            Else
                Beep
            End If
        End If
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Zero_Click()
    On Error Resume Next
    If OP = True Then
      Foglio1.Schermo.Text = ""
    End If
    lunghezza = Len(Foglio1.Schermo.Text)
    If lunghezza < 32 Then
        If Foglio1.Schermo.Text <> "0" Then
            Foglio1.Schermo.Text = Foglio1.Schermo.Text & "0"
        End If
        OP = False
    Else
        Beep
    End If
    Foglio1.Schermo.SetFocus
    End Sub
    
    Sub Trasferimento_Dati_Click()
    On Error Resume Next
    
    Range("A1").Value = Numeratore(I)
    
    I = I + 1
      If I > 6 Then
        I = 1
    
    'End If
    
    Numeratore(1) = 1
      Numeratore(2) = 2
       Numeratore(3) = 3
        Numeratore(4) = 4
         Numeratore(5) = 5
          Numeratore(6) = 6
           Numeratore(7) = 7
                
    If Numeratore(11) = 11 Then
      Foglio1.Range("H4:H9").Value = ""
    End If
    End If
    Range("H4").Value = Numeratore(I)
    Trasferimento_Dati_Foglio1
    End Sub


  • combinazione .se e calcoli?
    di federico (utente non iscritto) data: 09/10/2014 14:12:18

    Buongiorno a tutti,
    ho 5 colonne su un file ordinate in questo modo:

    n-------Y------------- --n------- comp----età
    1-----100-------------- 1---------2------- 13
    2-----150---------------1-------- 2-------65
    ... ---------------------- 2 ------- 1-------28
    .. ..

    Al numero di questionario n corrisponde un reddito Y e una composizione familiare (comp per numero componenti, e le rispettive età).
    Dovrei dividere ogni reddito Y per il numero dei componenti familiari moltiplicati per un coefficiente (1 per il primo adulti, 0,5 per i restanti adulti e 0,3 per ragazzi di età inferiore ai 16 anni).
    Ad esempio nel caso di n=1, dovrei ottenere: 100/(1+0,3). Per n=2 rimarrebbe 150.

    Non so proprio dove sbattere la capoccia, mi vanno bene anche diverse formule parziali, purché giunga al risultato. Grazie dell'attenzione



  • di federico (utente non iscritto) data: 09/10/2014 14:15:25

    mi scusi credo di aver sbagliato



  • di Zer0Kelvin data: 09/10/2014 14:58:20

    Ciao.
    Come mai non hai risposto a questo?
    h t t p://www.pc-facile.com/forum/viewtopic.php?f=26&t=102916#p597877



  • di lepat (utente non iscritto) data: 09/10/2014 15:26:21

    forse pensava che su questo forum ci fosse qualcuno dotato di superpoteri



  • di Zer0Kelvin data: 10/10/2014 17:53:08

    Beh! magari qui li trova:
    h t t p://www.manuali.net/forum/showthread.php?t=62776

    Comw si dice... "Il mondo è piccolo".