Moderatori: Anthony47, Flash30005
Sub sistemacolonne()
Range("E7:L200").ClearContents
Range("E7:E14").Select
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("E7"), DataType:=xlDelimited, _ '<<< si ferma da qui
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
Array(7, 1), Array(8, 1)), TrailingMinusNumbers:=True
Range("E4").Select
End Sub
Range("F7:L200").ClearContents
Sub adattoprelievo()
Dim aTabella As Variant
Dim nRiga As Long
Dim nCol As Integer
Dim uE As Long
With Foglio33
uE = .Range("E" & Rows.Count).End(xlUp).Row
aTabella = .Range("E7:K" & uE)
For nRiga = LBound(aTabella) To UBound(aTabella)
aTabella(nRiga, 2) = Mid(aTabella(nRiga, 2), 1, InStr(aTabella(nRiga, 2), "ID") - 2) ' <---
For nCol = 5 To 7
If IsNumeric(Replace(aTabella(nRiga, nCol), " ", ",")) Then
aTabella(nRiga, nCol) = CDbl(Replace(aTabella(nRiga, nCol), " ", ","))
End If
Next nCol
Next nRiga
.Range("E7:K" & uE) = aTabella
End With
End Sub
Sub TTCol()
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Application.DisplayAlerts = False
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 4), Array(2, 4), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
Array(7, 1), Array(8, 1), Array(9, 1)), TrailingMinusNumbers:=True
Columns("A:A").Select
Application.DisplayAlerts = True
Selection.Delete Shift:=xlToLeft
Range("A1").Select
End Sub
Worksheets("AccountStatement_All").Activate ' <<< il foglio dal quale dove preleva
Call TTCol 'AGGIUNTA, Chiamata alla Sub TestoInColonna
Range("a2:h1000").Copy ' il range di righe su cui operare
La macro apre il file AccountStatement_All.csv, che e' un file di testo non ancora "incolonnato" nel foglio Excel; quindi immagino che per prima cosa bisognera' fare un Testo in colonna.
A sentimento direi che probabilmente stai cercando di recuperare quelli che ora vengono chiamati " Ref: ",
Non sapendo come e' stato ottenuto il csv (mi pare la copia parziale di un sorgente html)
'----sommo x col M--------------------------------
'UR = Worksheets("betfaire").Range("e" & Rows.Count).End(xlUp).Row 'e le date
Worksheets("betfaire").Range("m7:m1000").ClearContents 'm dove metto totale
DataM = Day(Worksheets("betfaire").Range("e7").Value)
MDataM = Day(Worksheets("betfaire").Range("e7").Value)
Somma = 0
For RR = 7 To ur + 1
DataM = Day(Worksheets("betfaire").Range("e" & RR).Value)
If MDataM = DataM Then
Somma = Somma + Worksheets("betfaire").Range("k" & RR).Value 'L dove cercare x sommare
Else
Worksheets("betfaire").Range("m" & RR - 1).Value = Somma
MDataM = DataM
If IsNumeric(Worksheets("betfaire").Range("k" & RR).Value) Then Somma = Somma + Worksheets("betfaire").Range("k" & RR).Value
If IsNumeric(Worksheets("betfaire").Range("k" & RR).Value) Then Somma = Worksheets("betfaire").Range("k" & RR).Value
With Foglio33
uE = .Range("E" & Rows.Count).End(xlUp).Row
aTabella = .Range("E7:K" & uE)
lb2 = LBound(aTabella, 2)
For nRiga = LBound(aTabella) To UBound(aTabella)
If UCase(Left(aTabella(nRiga, lb2 + 1), 8)) = "INCONTRI" Then
lfslash = InStr(1, aTabella(nRiga, lb2 + 1), "/", vbTextCompare)
If lfslash > 0 Then
aTabella(nRiga, lb2 + 1) = Trim(Mid(aTabella(nRiga, lb2 + 1), lfslash + 1, 999))
End If
End If
aTabella(nRiga, 2) = Mid(aTabella(nRiga, 2), 1, InStr(aTabella(nRiga, 2), "Ref") - 2)
For nCol = 5 To 7
If IsNumeric(Replace(aTabella(nRiga, nCol), " ", ",")) Then
aTabella(nRiga, nCol) = CDbl(Replace(aTabella(nRiga, nCol), " ", ","))
End If
Next nCol
Next nRiga
.Range("E7:K" & uE) = aTabella
End With
E' la penultima richiesta, vero![]()
![]()
![]()
' altro codice
ThisWorkbook.Activate '<<< ESISTENTE
For Each myC In Range(Range("K7"), Range("K7").End(xlDown))
If Len(myC.Value) > 1 Then
myC.Value = Val(Trim(myC.Value))
End If
Next myC
Sheets("betfaire").Select '<<< SEGUE CODICE ESISTENTE
Range("e7").Select ' la cella dove incollare i dati
' altro codice
'...
inoltre nella col F importa il tutto correttamente
ma ora alla fine di ogni riga, mette un lineetta verticale.
vorrei poterla togliere.
Torna a Applicazioni Office Windows
Inserire dati filtrati da 2 file ad un terzo file Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 14 |
File batch per copiare file selezionato da menu contestuale Autore: valle1975 |
Forum: Programmazione Risposte: 3 |
copia di dati da un file chiuso e elaborazione Autore: luca62 |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Nessuno e 68 ospiti