Una famiglia di software per fogli di calcolo Microsoft con strumenti per l'analisi, la creazione di grafici e la comunicazione dei dati.
I CODICI (UGUALI NELLA COLONNA A E NELLA COLONNA E (UGUALI SOLO PER LE PRIME 13 LETTERE)
ESEMPIO:
A5 65 affiancato ad E1 100 :
Z-------------------------- 65 Z-------------------------- 100(PER POTER CONFRONTARE I DUE DATI)
Questa macro, da copia/incollare in un modulo standard, fa quanto chiedi nel file che mi hai mandato:
Public Sub m()
Dim sh As Worksheet
Dim lRigaA As Long
Dim lRigaE As Long
Dim lngA As Long
Dim lngE As Long
Set sh = ThisWorkbook.Worksheets("Foglio1")
With sh
lRigaA = .Range("A" & .Rows.Count).End(xlUp).Row
lRigaE = .Range("E" & .Rows.Count).End(xlUp).Row
For lngE = 1 To lRigaE
For lngA = 1 To lRigaA
If Left(.Range("E" & lngE).Value, 13) = _
Left(.Range("A" & lngA).Value, 13) Then
.Range("C" & lngA).Value = .Range("E" & lngE).Value
.Range("D" & lngA).Value = .Range("F" & lngE).Value
Exit For
End If
Next
Next
End With
Set sh = Nothing
End Sub
Se non hai mai utilizzato le macro, vedi qui: http://www.maurogsc.eu/excel/xlsdoveinserirecodice.aspx . Ti ricordo che se utilizzi Excel 2007 o Excel 2010, il file deve essere salvato con estensione .xlsm o .xls.