Dear All,
My name is Dusan and this is my first post in the forum. I have been using it for quite some time now, and the reason I am boring you with this question is because I have not been able to find the answer anywhere... Here it goes:
I have 50.000 lines in the .txt file (50.000 different colors, basically), where left column represents the color code, while the right columns represents the decimal value of the color:
Colr_code Rgb_colour
C3796 4861223
C3797 4729123
C3798 4728608
C3799 4662302
C3800 4464666
C3801 4267031
--------------
The excel file I use has cells with values seen in the left column (C3796, C3797....C3800, etc...).
I want to color the cell based on their values, but since I have 50.000 different colors, the "if" will not work, as the vba cannot handle more than 1.000 IF lines (maybe even less).
I have tried the following:
For Each c In selection
If c.Value = "C3796" Then c.Interior.Color = 4861223
If c.Value = "C3797" Then c.Interior.Color = 4729123
etc...
this works for the coloring, but I cannot put 50.000 IF lines in the VBA code.
So, I need to use the .txt file, but I do no know how to read the data and color the cells based on the data present in the .txt file.
I hope I was clear
Thank you very much in advance! ray:ray:ray:
Best regards,
Dusan
My name is Dusan and this is my first post in the forum. I have been using it for quite some time now, and the reason I am boring you with this question is because I have not been able to find the answer anywhere... Here it goes:
I have 50.000 lines in the .txt file (50.000 different colors, basically), where left column represents the color code, while the right columns represents the decimal value of the color:
Colr_code Rgb_colour
C3796 4861223
C3797 4729123
C3798 4728608
C3799 4662302
C3800 4464666
C3801 4267031
--------------
The excel file I use has cells with values seen in the left column (C3796, C3797....C3800, etc...).
I want to color the cell based on their values, but since I have 50.000 different colors, the "if" will not work, as the vba cannot handle more than 1.000 IF lines (maybe even less).
I have tried the following:
For Each c In selection
If c.Value = "C3796" Then c.Interior.Color = 4861223
If c.Value = "C3797" Then c.Interior.Color = 4729123
etc...
this works for the coloring, but I cannot put 50.000 IF lines in the VBA code.
So, I need to use the .txt file, but I do no know how to read the data and color the cells based on the data present in the .txt file.
I hope I was clear
Thank you very much in advance! ray:ray:ray:
Best regards,
Dusan