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

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

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.

See also  Lesson#194: Make an area calculator for Triangles, Rectangles, and Circle in VBA

Hi! I am Puspendu. I am the founder and author of Excelabcd. I am little creative person, blogger and Excel-maniac guy. I hope you enjoy my blog.

Leave a Reply

Your email address will not be published. Required fields are marked *

*