I am sorry, something went wrong with my keyboard.
I have defined Columns like this:
Code:
Kolona2 = Kolona_umetanje
Raspon1 = 1
Raspon2 = Lastrow
' Column to the right of Column2
Kolona_3 = Range(Kolona2 + ":" + Kolona2).Offset(0, 1).Address(0, 0, xlA1)
p1 = InStr(Kolona_3, ":")
Kolona_3 = Left(Kolona_3, p1 - 1)
' Column to the right of Column_3
Kolona_4 = Range(Kolona_3 + ":" + Kolona_3).Offset(0, 1).Address(0, 0, xlA1)
p2 = InStr(Kolona_4, ":")
Kolona_4 = Left(Kolona_4, p2 - 1)
' Column to the right of Column_4
Kolona_5 = Range(Kolona_4 + ":" + Kolona_4).Offset(0, 1).Address(0, 0, xlA1)
p3 = InStr(Kolona_5, ":")
Kolona_5 = Left(Kolona_5, p3 - 1)
And I use FuzzyVLookup function like this to insert 4 numbers for devices:
Code:
ActiveSheet.Range(Kolona2 & Raspon1).Select
ActiveCell.Formula = "=FuzzyVLookup(" & Kolona1 & "" & Raspon1 & ",'[BAZA_USPOREDBA.xlsm]BAZA_MOSAIC'!$A$1:$d$200,2,,,3)" '
ActiveSheet.Range(Kolona2 & Raspon1).Select
ActiveCell.Select
Selection.AutoFill Destination:=Range(Kolona2 & Raspon1, Kolona2 & Raspon2)
ActiveSheet.Range(Kolona2 & Raspon1, Kolona2 & Raspon2).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Range(Kolona_3 & Raspon1).Select
ActiveCell.Formula = "=FuzzyVLookup(" & Kolona1 & "" & Raspon1 & ",'[BAZA_USPOREDBA.xlsm]BAZA_MOSAIC'!$A$1:$d$200,3,,,3)" '
ActiveSheet.Range(Kolona_3 & Raspon1).Select
ActiveCell.Select
Selection.AutoFill Destination:=Range(Kolona_3 & Raspon1, Kolona_3 & Raspon2)
ActiveSheet.Range(Kolona_3 & Raspon1, Kolona_3 & Raspon2).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Range(Kolona_4 & Raspon1).Select
ActiveCell.Formula = "=FuzzyVLookup(" & Kolona1 & "" & Raspon1 & ",'[BAZA_USPOREDBA.xlsm]BAZA_MOSAIC'!$A$1:$d$200,4,,,3)" '
ActiveSheet.Range(Kolona_4 & Raspon1).Select
ActiveCell.Select
Selection.AutoFill Destination:=Range(Kolona_4 & Raspon1, Kolona_4 & Raspon2) '
ActiveSheet.Range(Kolona_4 & Raspon1, Kolona_4 & Raspon2).Select '
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Range(Kolona_5 & Raspon1).Select
ActiveCell.Formula = "=FuzzyVLookup(" & Kolona1 & "" & Raspon1 & ",'[BAZA_USPOREDBA.xlsm]BAZA_MOSAIC'!$A$1:$d$200,5,,,3)" '
ActiveSheet.Range(Kolona_5 & Raspon1).Select
ActiveCell.Select
Selection.AutoFill Destination:=Range(Kolona_5 & Raspon1, Kolona_5 & Raspon2) '
ActiveSheet.Range(Kolona_5 & Raspon1, Kolona_5 & Raspon2).Select '
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Some device have 2 numbers some 5 or 6. Can we adapt your code in a way if FuzzyVLookup finds match to copy as many numbers we have in row for each device?
[TABLE="class: cms_table, width: 384"]
<tbody>[TR]
[/TR]
[TR]
[TD="class: cms_table_xl63, width: 64"]Device 1[/TD]
[TD="class: cms_table_xl63, width: 64, align: right"]2[/TD]
[TD="class: cms_table_xl63, width: 64, align: right"]3[/TD]
[TD="class: cms_table_xl63, width: 64, align: right"][/TD]
[TD="class: cms_table_xl63, width: 64, align: right"][/TD]
[TD="class: cms_table_xl63, width: 64, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63"]Device 2[/TD]
[TD="class: cms_table_xl63, align: right"]5[/TD]
[TD="class: cms_table_xl63, align: right"]6[/TD]
[TD="class: cms_table_xl63, align: right"]7[/TD]
[TD="class: cms_table_xl63, align: right"]8[/TD]
[TD="class: cms_table_xl63"]78[/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63"]Device3[/TD]
[TD="class: cms_table_xl63, align: right"]3[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63"]Device4[/TD]
[TD="class: cms_table_xl63, align: right"]5634[/TD]
[TD="class: cms_table_xl63, align: right"]653[/TD]
[TD="class: cms_table_xl63, align: right"]3453[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63"]Device5[/TD]
[TD="class: cms_table_xl63, align: right"]6345[/TD]
[TD="class: cms_table_xl63, align: right"]34563[/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63, align: right"][/TD]
[TD="class: cms_table_xl63"][/TD]
[/TR]
[TR]
[TD="class: cms_table_xl63"][/TD]
[TD="class: cms_table_xl63, align: center"][/TD]
[TD="class: cms_table_xl63, align: center"][/TD]
[TD="class: cms_table_xl63, align: center"][/TD]
[TD="class: cms_table_xl63, align: center"][/TD]
[/TR]
</tbody>[/TABLE]
Thanks