First of all, thanks to the community as using the forum search I've already got my basic code working. Now I'm looking for some guidance as to how to clean up what I've done already.
I have a drawing with autoshapes representing parts that need to be inspected. The important data in my table consists of the part number, and a dropdown box where I can select OK, WATCH, or CHANGE. Right now I have this macro that successfully changes the color of the part on the map based on the dropdown box.
So, this is working. Unfortunately I have 50 parts and 50 shapes that need the same treatment. Now if I just wanted to be inefficient and clunky I could just copy the above 50 times and rename by hand, but there's sleeker ways of doing it that I haven't grasped yet. I'm hoping you fine folks will help me out and save me some tedious work that would be in my future.![]()
If Sheets("date last scanned").Range("H4") = "CHANGE" Then Sheets("roll map").Shapes("#01").Fill.ForeColor.RGB = RGB(255, 0, 0) End If If Sheets("date last scanned").Range("H4") = "OK" Then Sheets("roll map").Shapes("#01").Fill.ForeColor.RGB = RGB(0, 175, 80) End If If Sheets("date last scanned").Range("H4") = "WATCH" Then Sheets("roll map").Shapes("#01").Fill.ForeColor.RGB = RGB(233, 238, 34) End If
Info that may help:
-currently my shapes are named #01, #02, etc but that can be changed if it makes it easier
-the cells are in order starting from H4 (#01 for H4, #02 for H5, etc)
Thanks in advance
Bookmarks