Forum Discussion
minhhai91
Jun 24, 2021Copper Contributor
Mapping between 2 sheets: Assign the value of a row according to the values of a column
Hello, I want to map between 2 sheets, that is to say that in my first sheet (synthesis) I have a list of Group Number and in my second group I have a list of entity attached to these groups and ...
- Jun 24, 2021
You can do this without VBA: in A6, enter the formula
=VLOOKUP(Synthèse!B6,Mapping!$A$2:$B$3,2,FALSE)
and fill down.
If you prefer a macro:
Sub RemplirEntité() Dim m As Long With Worksheets("Synthèse") m = .Range("B" & .Rows.Count).End(xlUp).Row With .Range("A6:A" & m) .Formula = "=IFERROR(VLOOKUP(Synthèse!B6,Mapping!$A$2:$B$3,2,FALSE),"""")" .Value = .Value End With End With End Sub
HansVogelaar
Jun 24, 2021MVP
You can do this without VBA: in A6, enter the formula
=VLOOKUP(Synthèse!B6,Mapping!$A$2:$B$3,2,FALSE)
and fill down.
If you prefer a macro:
Sub RemplirEntité()
Dim m As Long
With Worksheets("Synthèse")
m = .Range("B" & .Rows.Count).End(xlUp).Row
With .Range("A6:A" & m)
.Formula = "=IFERROR(VLOOKUP(Synthèse!B6,Mapping!$A$2:$B$3,2,FALSE),"""")"
.Value = .Value
End With
End With
End Sub
- minhhai91Jun 24, 2021Copper ContributorThanks a lot