ThatOneGuy_1337
New Member
- Joined
- Apr 11, 2022
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi all,
I have a macro that works but I need to convert it and my VBA knowledge isn't good enough to do this myself.
Long story short it colors cells based on colors in a different sheet.
Currently vertical coloring is working:
(It looks for the value on top, and then proceeds to color the amount of blocks based on the amount of times it finds that value in a different sheet)
Now I would need the macro to be able to color horizontal as well:
This is the code that is coloring the cells:
It gets the values from a vlookup in a sheet where the locations of the cells are given
If anybody could help converting this code to work vertically it would be a huge help! I can provide a test file if needed to see how it all works.
I have a macro that works but I need to convert it and my VBA knowledge isn't good enough to do this myself.
Long story short it colors cells based on colors in a different sheet.
Currently vertical coloring is working:
(It looks for the value on top, and then proceeds to color the amount of blocks based on the amount of times it finds that value in a different sheet)
Now I would need the macro to be able to color horizontal as well:
This is the code that is coloring the cells:
VBA Code:
'Coloring
For Each c3 In ws.Range(ws.Cells(BeginRow, kolominws), ws.Cells(EndRow, kolominws))
If c3.Interior.Color = 16777215 And c3.MergeCells = False Then
c3.Interior.Color = kleur
c.Interior.Color = kleur
Exit For
End If
Next c3
Next c
It gets the values from a vlookup in a sheet where the locations of the cells are given
VBA Code:
BeginRow = Application.WorksheetFunction.VLookup(blok, rangews.Range("A:G"), 6, False)
EndRow = Application.WorksheetFunction.VLookup(blok, rangews.Range("A:G"), 7, False)
BeginColumn = Application.WorksheetFunction.VLookup(blok, rangews.Range("A:H"), 8, False)
If anybody could help converting this code to work vertically it would be a huge help! I can provide a test file if needed to see how it all works.
Last edited by a moderator: