Forum

excel vba - extensi...
 
Notifications
Clear all

excel vba - extension of coloring text - using separate sheet for array range

3 Posts
2 Users
0 Reactions
71 Views
(@cawalawan)
Posts: 4
Active Member
Topic starter
 

Thank you so much for the code of coloring text — it is smart, efficient, elegant, and I would never have been able to do this. I also incorporated your suggestion for making the text that is colored bold and it worked great and I am loving it!.

However, I do have about 325 elements in my arrays. I can manually put these elements in the VBA code and it works, but I would prefer to have a separate worksheet with 3 columns that have MyWords, MyColors, and MakeBold elements and refer to these columns in the subroutine.

I have tried many things but my last try was inserting as follows:
Dim BoldRange As Range
Set BoldRange = Worksheets(“Products”).Range(“C2:C11”)
MakeBold = BoldRange
When I run the subroutine, I get an error the Join$(MyWords) statement.

I have attached the file.

If you can help me out, I would appreciate it.
I will continue working on it. Again, Thank you so much!!

 
Posted : 15/08/2023 12:52 pm
(@debaser)
Posts: 837
Member Moderator
 

There are quite a few issues with that code, not least the fact that you can't use text like vbRed or rgb(153,40,10) in a cell as VBA code. I suggest you alter the ProdColour cells so that you fill them with the colour you want (it will be easier to maintain too, in my opinion) and have the code pick up the fill colours instead.

 

Attached is a revised sample of your workbook, with the cells coloured to match the values you had typed in.

 
Posted : 16/08/2023 5:02 am
(@cawalawan)
Posts: 4
Active Member
Topic starter
 

Your suggestion worked perfectly and the result will be appreciated by many people!  Thank you Velouria, you are the best!

 
Posted : 17/08/2023 7:07 am
Share: