Hi guys,
I have this VBA problem to solve, and as Im new to VBA, your help would be priceless.
I have already a code developed thats drawing a Gantt chart based on different data. For those unfamiliar with Gantt charts, its a graphical presentation with shapes and boxes of different colors.
In each of those boxes there is a string similar to this one: AB = 2.72. I need to apply conditional formating to make the figure red if it exceeds 2. It makes it harder for me that the string is within the box, as its not refering to any particular cell. As the code is quite long, I'll just point out the most important parts of it that I think need to be used for conditional formating.
The part about the string within the box is:
inBoxString = " AB: " & Round((Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_ENDTIME_COL) - Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_STARTTIME_COL)) * 24, 2)
This inboxtring is placed within the shape, and it looks smth like: AB = 2.7. The value 2.7 is this part of the code from above:
Round((Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_ENDTIME_COL) - Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_STARTTIME_COL)) * 24, 2)
Where:
Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_ENDTIME_COL)
and:
Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_STARTTIME_COL)
are dates, and the difference is giving a duration (2.7). The codes is much longer than this, so please let me know if I need to go into more details.
Would you please be able to help me with this?
I have this VBA problem to solve, and as Im new to VBA, your help would be priceless.
I have already a code developed thats drawing a Gantt chart based on different data. For those unfamiliar with Gantt charts, its a graphical presentation with shapes and boxes of different colors.
In each of those boxes there is a string similar to this one: AB = 2.72. I need to apply conditional formating to make the figure red if it exceeds 2. It makes it harder for me that the string is within the box, as its not refering to any particular cell. As the code is quite long, I'll just point out the most important parts of it that I think need to be used for conditional formating.
The part about the string within the box is:
inBoxString = " AB: " & Round((Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_ENDTIME_COL) - Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_STARTTIME_COL)) * 24, 2)
This inboxtring is placed within the shape, and it looks smth like: AB = 2.7. The value 2.7 is this part of the code from above:
Round((Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_ENDTIME_COL) - Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_STARTTIME_COL)) * 24, 2)
Where:
Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_ENDTIME_COL)
and:
Worksheets(RAKE_DATA_SHEET).Cells(i, RAKE_DATA_STARTTIME_COL)
are dates, and the difference is giving a duration (2.7). The codes is much longer than this, so please let me know if I need to go into more details.
Would you please be able to help me with this?