Dividere celle



  • Dividere celle
    di bumics81 (utente non iscritto) data: 22/01/2015 12:48:06

    Ciao a tutti.. Ho un problema che non riesco a risolvere e spero che con il vostro aiuto ne vengo a capo.
    Nelle range A83: A90 ho un testo formato con 2 parole separato da un trattino (xxxxx-xxxxx) quello che vorrei fare io è separare questo testo mettendolo in 2 celle e rispettivamente in AI e AJ..Grazie anticipatamente



  • di ninai (utente non iscritto) data: 22/01/2015 13:02:20

    ciao
    una delle possibili soluzioni, in AI83:
    =SINISTRA(A83;TROVA("-";A83)-1)
    in Aj83:
    =DESTRA(A83;LUNGHEZZA(A83)-TROVA("-";A83))

    Se è un operazione da fare poche volte, puoi usare , da menù dati, "testo in colonne"


  • dividere cella
    di bumics81 (utente non iscritto) data: 22/01/2015 13:31:08

    Grazie adesso provo e ti faccio vedere. Io avevo pensato ad una macro ma non ci riesco proprio.Cmq grazie mille ti farò sapere


  • dividere cella
    di bumics81 (utente non iscritto) data: 22/01/2015 14:10:21

    Grazieeeee..funziona



  • di Vecchio Frac data: 22/01/2015 14:26:37

    cit. "avevo pensato ad una macro ma non ci riesco proprio"
    ---> Con codice VBA.
     
    Option Explicit
    
    Sub separa()
    Dim cell As Range, v As Variant
        For Each cell In Range("A83:A90")
            v = Split(cell, "-")
            If UBound(v) > 0 Then
                Cells(cell.Row, "AI") = v(0)
                Cells(cell.Row, "AJ") = v(1)
            End If
        Next
    End Sub
    





  • vba
    di bumics81 (utente non iscritto) data: 22/01/2015 19:17:19

    Grazie mille funziona benissimo anche questa.Se posso rubarvi un attimo del vostro tempo vorrei porvi un'altro quesito: sto utilizzando un codice vba scopiazzato qua e la su internet per estrapolare delle tabelle da internet, il punto è che non riesco a fare posizionare la singola tabella che estraggo su una singola cella che stabilisco io. In allegato vi mando il codice..Grazie mille per la vostra disponibilità.
     
    ub GetTabbb()
    Sheets("ItaliaA").Activate
    ' PULISCE FOGLIO
        Range("A1").Select
        Selection.ClearContents
    myURL = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    Set ie = CreateObject("InternetExplorer.Application")
       
    
    'Range("A:C").Clear
       
    With ie
        .navigate myURL
    
        Do While .Busy: DoEvents: Loop    'Attesa not busy
        Do While .readyState <> 4: DoEvents: Loop 'Attesa documento
    End With
    '
    myStart = Timer  'attesa addizionale
    Do
        DoEvents
        If Timer > myStart + 2 Or Timer < myStart Then Exit Do
    Loop
    
    
    'Cells.Clear
    Set mycoll = ie.document.getElementsByTagName("TABLE")
    For Each myItm In mycoll
        For Each trtr In myItm.Rows
            For Each tdtd In trtr.Cells
                Cells(i + 1, J + 1) = tdtd.innerText
                J = J + 1
            Next tdtd
            i = i + 1: J = 0
        Next trtr
    i = i + 1
    Next myItm
    Sheets("ItaliaA").Activate
    ' PULISCE FOGLIO
        Range("A35").Select
        Selection.ClearContents
    myURL = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
    Set ie = CreateObject("InternetExplorer.Application")
       
    
    'Range("A:C").Clear
       
    With ie
        .navigate myURL
    
        Do While .Busy: DoEvents: Loop    'Attesa not busy
        Do While .readyState <> 4: DoEvents: Loop 'Attesa documento
    End With
    '
    myStart = Timer  'attesa addizionale
    Do
        DoEvents
        If Timer > myStart + 2 Or Timer < myStart Then Exit Do
    Loop
    
    
    'Cells.Clear
    Set mycoll = ie.document.getElementsByTagName("TABLE")
    For Each myItm In mycoll
        For Each trtr In myItm.Rows
            For Each tdtd In trtr.Cells
                Cells(i + 1, J + 1) = tdtd.innerText
                J = J + 1
            Next tdtd
            i = i + 1: J = 0
        Next trtr
    i = i + 1
    Next myItm
    Sheets("ItaliaA").Activate
    ' PULISCE FOGLIO
        Range("A60").Select
        Selection.ClearContents
    myURL = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
    Set ie = CreateObject("InternetExplorer.Application")
       
    
    'Range("A:C").Clear
       
    With ie
        .navigate myURL
    
        Do While .Busy: DoEvents: Loop    'Attesa not busy
        Do While .readyState <> 4: DoEvents: Loop 'Attesa documento
    End With
    '
    myStart = Timer  'attesa addizionale
    Do
        DoEvents
        If Timer > myStart + 2 Or Timer < myStart Then Exit Do
    Loop
    
    
    'Cells.Clear
    Set mycoll = ie.document.getElementsByTagName("TABLE")
    For Each myItm In mycoll
        For Each trtr In myItm.Rows
            For Each tdtd In trtr.Cells
                Cells(i + 1, J + 1) = tdtd.innerText
                J = J + 1
            Next tdtd
            i = i + 1: J = 0
        Next trtr
    i = i + 1
    Next myItm
    
    Sheets("ItaliaA").Activate
    'PULISCE IL FOGLIO
    Range("A82").Select
    Selection.ClearContents
    myURL = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
             
    Set ie = CreateObject("InternetExplorer.Application")
       
    
    'Range("A:C").Clear
       
    With ie
        .navigate myURL
    
        Do While .Busy: DoEvents: Loop    'Attesa not busy
        Do While .readyState <> 4: DoEvents: Loop 'Attesa documento
    End With
    '
    myStart = Timer  'attesa addizionale
    Do
        DoEvents
        If Timer > myStart + 2 Or Timer < myStart Then Exit Do
    Loop
    
    
    'Cells.Clear
    Set mycoll = ie.document.getElementsByTagName("TABLE")
    For Each myItm In mycoll
        For Each trtr In myItm.Rows
            For Each tdtd In trtr.Cells
                Cells(i + 1, J + 1) = tdtd.innerText
                J = J + 1
            Next tdtd
            i = i + 1: J = 0
        Next trtr
    i = i + 1
    Next myItm
    
    End Sub



  • di scossa data: 23/01/2015 13:59:55

    cit. ninai: "=DESTRA(A83;LUNGHEZZA(A83)-TROVA("-";A83)) "

    Il solito sprecone!

    =STRINGA.ESTRAI(A83;TROVA("-";A83)+1;9^9)


    scossa's web site
    Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno.
    Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw)



  • di bumics81 (utente non iscritto) data: 23/01/2015 19:28:54

    ragazzi scusate ancora vi posso mandare il mio file per spiegarvi meglio le mie difficoltà?? Sono in confusione..Grazie