tracker roulette



  • tracker roulette
    di hotroulettaro (utente non iscritto) data: 31/12/2013 17:34:24

    Tracker roulette
    Ciao a tutti, ho bisogno di aiuto xche' non conosco excel. Devo creare un foglio elettronico automatico per registrare i numeri delle permanenze della roulette. Il file l'ho gia creato ma devo automatizzarlo (vedi allegato). Ho bisogno che quando carico una permanenza in A1 (anche 20000 dati)da un formato dat. o txt. venga automaticamente disposta una "x" sulla corrispettiva riga e sotto la colonna del numero in questione (vedi esempio).

    L'automatismo deve riguardare come minimo 20000 righe.
    esempio
    permanenza 0 32 15 19 4 21.........26
    32 x
    4 x
    21 x
    0 x
    15 x



    Grazie a tutti per l'aiuto.



  • di gaetanopr data: 31/12/2013 18:38:47

    prova con questa macro, magari sarà un pò lenta con 20000 righe

    Ciao
     
    Option Explicit
    Sub xxxxx()
    Dim LastRow As Long, i As Long, n As Long
    LastRow = Cells(Rows.Count, 1).End(xlUp).Row
    
    Range("B4:AL" & LastRow).ClearContents
    For i = 4 To LastRow
      For n = 2 To 38
         If Cells(i, 1).Value = Cells(3, n).Value Then
            Cells(i, n).Value = "x"
            Exit For
         End If
      Next
    Next
     
    End Sub
    



  • di gaetanopr data: 31/12/2013 18:58:48

    Forse con il metodo Find è più veloce
     
    Option Explicit
    Sub xxxxx()
    
    Dim LastRow As Long, i As Long
    Dim n As Long, ID As Integer, rng As Range, firstAddress As String
    LastRow = Cells(Rows.Count, 1).End(xlUp).Row
    
    With Range("A3:A" & LastRow)
       For n = 2 To 38
           ID = Cells(3, n)
           Set rng = .Find(What:=ID, LookAt:=xlWhole, LookIn:=xlValues)
           If Not rng Is Nothing Then
              firstAddress = rng.Address
              Do
              Cells(rng.Row, n).Value = "x"
             Set rng = .FindNext(rng)
             Loop While Not rng Is Nothing And rng.Address <> firstAddress
           End If
        Next n
     End With
    
    End Sub



  • di isy data: 31/12/2013 19:38:33

    Ciao

    Cit: Forse con il metodo Find è più veloce

    Una ricerca con gli array ad esempio
     
    Option Explicit
    
    Sub Test_Ricerca()
      Dim LastRow As Long, i As Long, n As Long
      Dim rngK, rngL, arr(), x
      LastRow = Cells(Rows.Count, 1).End(xlUp).Row
      rngK = Range("A4:A" & LastRow)
      ReDim arr(1 To UBound(rngK), 1 To 37)
      rngL = Range("B3:AL3")
      For i = 1 To UBound(rngK, 1)
        x = rngK(i, 1)
        For n = 1 To UBound(rngL, 2)
           If x = rngL(1, n) Then
              arr(i, n) = "x"
              Exit For
           End If
        Next
      Next
      Range("B4:AL" & LastRow) = arr
    End Sub



  • di hotroulettaro (utente non iscritto) data: 31/12/2013 19:53:53

    Grazie a tutti,
    purtroppo non ho la piu' pallida idea di come utilizzare le info. che avete postato. Come ho detto in excel sono una capra. Qualcuno sarebbe cosi' gentile da programmare il foglio excel e postarlo ?
    Grazie
    Luigi



  • di hotroulettaro (utente non iscritto) data: 01/01/2014 01:34:36

    Ci sono riuscito... sarà stato merito dello champagne.
    Grazie a tutti