Forum Discussion
AlexMillar
Jun 28, 2022Copper Contributor
Formatting based on searching for identical cell in another sheet
Hi, Does anyone know if it is possible to do this? I have two spreadsheets containing data from two consecutive months. In the earlier spreadsheet, let's say I have a list of customers colour cod...
OliverScheurich
Jun 28, 2022Gold Contributor
Sub color()
Dim i As Integer
Dim j As Integer
Dim company As Range
Set company = Tabelle1.Range("B2:B10000")
For i = 2 To 26
j = Application.WorksheetFunction.Match(Tabelle2.Cells(i, 2), company, 0)
Tabelle2.Cells(i, 13).Interior.ColorIndex = Tabelle1.Cells(j + 1, 2).Interior.ColorIndex
Tabelle2.Cells(i, 13).Value = Tabelle1.Cells(j + 1, 13).Value
Next i
End Sub
Maybe with this code. In the attached file you can click the button in cell G2 to start the macro.
AlexMillar
Jun 28, 2022Copper Contributor
Thank you! I suspect this is the perfect solution in the hands of a more competent user but unfortunately I'm a bit too clueless to make the necessary adjustments and take that over to my spreadsheets without some learning so I'll look into it a bit more if I don't find a way that is within my circle of competence!