Lesson#127: Trick to make a color picker with VBA

An easy and simple trick to make a color picker will be shown here.

Here I have made a color palette by coloring different cells with different colors. This palette allows us to pick different types of colors by selecting cells.

I designated a certain area where the chosen color will be shown.
Now I have inserted a button from the developer tab and assigned a simple macro.
Sub Button2_Click()
Range(“O2:R8”).Interior.Color = ActiveCell.Interior.Color
End Sub
Range(“O2:R8”).Interior.Color = ActiveCell.Interior.Color
End Sub
Whereas Range(“O2:R8”) is the designated area for showing the picked color.
Now you have to select any color palette and click on the button to show the color in the O2;R8 area.
Here I have given the file to you.
Leave a Reply