Hello,
I would like to know how to set up a macro that could automatically code code cells if a certain condition was met.
If I have downloaded some information into excel and say column "D" shows a two-digit code, with the second number indicating the month i.e. 22 would mean calendar year 2002, the 2th month or Feb. 2002. Say column "E" shows a lead-tme variable in days i.e. 45 days. The lead time variable would start beginning with the month indicating by the second number of the two-digit code. The months are shown beginning with January through December in column "F' through "Q".
My objective would be to look at each line of the database and: 1) split out the second number of the two-digit year month to derive the month number i.e. if a "2" then February; and 2) look at the lead-time number and understands the month that it would get shipped in beginning with the month indicated by the second number of the two-digit code i.e. "2" for February.
For example, If I downloaded Jan through Decemer monthly forecast, and the number in column "D3" is "22", I would have to start the process at the column which shows February 2002 - column "F3". I would want to color code that cell and through April because the 45-day lead time would start in February and go one and a half month through April. Unfortunately, the macro has to look at each row because the lead-time will be different for each product line. For example, the next row down, the lead-time may be 84 days, resulting in February through May needing to be color coded.
To attempt to start this I have created two columns in "AA" and "AB" that shows the second digit of the two-digit month code and the lead-time translated into the month that it would fall into. In my first example of "22" and "45 day" lead time, "AA3" would show "2" and "AB3" would show "2" because 45 days equals one-and-a-half months and starting with February that would fall into the month of April, the second or "2" months after February. I recorded a macro that integrates Excel formulas to do this process.
My challenge now is to write a macro that can look at columns "AA" and "AB" for a large row area and color code a range that starts at say "D3 through Q200" for January through December. Unfortuately, this range will also change each month.
I appreciate any assistance in attempting to understand this challenge and helping me with it.
Thanks,
Diana
I would like to know how to set up a macro that could automatically code code cells if a certain condition was met.
If I have downloaded some information into excel and say column "D" shows a two-digit code, with the second number indicating the month i.e. 22 would mean calendar year 2002, the 2th month or Feb. 2002. Say column "E" shows a lead-tme variable in days i.e. 45 days. The lead time variable would start beginning with the month indicating by the second number of the two-digit code. The months are shown beginning with January through December in column "F' through "Q".
My objective would be to look at each line of the database and: 1) split out the second number of the two-digit year month to derive the month number i.e. if a "2" then February; and 2) look at the lead-time number and understands the month that it would get shipped in beginning with the month indicated by the second number of the two-digit code i.e. "2" for February.
For example, If I downloaded Jan through Decemer monthly forecast, and the number in column "D3" is "22", I would have to start the process at the column which shows February 2002 - column "F3". I would want to color code that cell and through April because the 45-day lead time would start in February and go one and a half month through April. Unfortunately, the macro has to look at each row because the lead-time will be different for each product line. For example, the next row down, the lead-time may be 84 days, resulting in February through May needing to be color coded.
To attempt to start this I have created two columns in "AA" and "AB" that shows the second digit of the two-digit month code and the lead-time translated into the month that it would fall into. In my first example of "22" and "45 day" lead time, "AA3" would show "2" and "AB3" would show "2" because 45 days equals one-and-a-half months and starting with February that would fall into the month of April, the second or "2" months after February. I recorded a macro that integrates Excel formulas to do this process.
My challenge now is to write a macro that can look at columns "AA" and "AB" for a large row area and color code a range that starts at say "D3 through Q200" for January through December. Unfortuately, this range will also change each month.
I appreciate any assistance in attempting to understand this challenge and helping me with it.
Thanks,
Diana