KlayontKress
Board Regular
- Joined
- Jan 20, 2016
- Messages
- 67
- Office Version
- 2016
- Platform
- Windows
To all,
I'm looking for a macro that will start in cell D6 and see if the cell contains the word "Custom" anywhere in the cell and if so, highlight the column to the last row with data in it. I then need it to move over to D6 and repeat until it encounters the last column with data with it at which point it will end. The number of options is variable so this may only gown down to F11 or it may go to F300 depending on the options a customer wants quoted.
In the chart below, the macro would start in D4 but it would only highlight from F4:F11.
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Customer name
[/TD]
[TD]blah blah[/TD]
[TD]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]Date[/TD]
[TD]blah blah[/TD]
[TD]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Room name[/TD]
[TD][/TD]
[TD][/TD]
[TD]Standard Room 1[/TD]
[TD]Standard Room 2[/TD]
[TD]Custom Room 3[/TD]
[TD]Standard Room 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]level 1[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]level 2[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]level 3[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Option 1[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Option 2[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Option 3
[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance,
I'm looking for a macro that will start in cell D6 and see if the cell contains the word "Custom" anywhere in the cell and if so, highlight the column to the last row with data in it. I then need it to move over to D6 and repeat until it encounters the last column with data with it at which point it will end. The number of options is variable so this may only gown down to F11 or it may go to F300 depending on the options a customer wants quoted.
In the chart below, the macro would start in D4 but it would only highlight from F4:F11.
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Customer name
[/TD]
[TD]blah blah[/TD]
[TD]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]Date[/TD]
[TD]blah blah[/TD]
[TD]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Room name[/TD]
[TD][/TD]
[TD][/TD]
[TD]Standard Room 1[/TD]
[TD]Standard Room 2[/TD]
[TD]Custom Room 3[/TD]
[TD]Standard Room 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]level 1[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]level 2[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]level 3[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Option 1[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Option 2[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Option 3
[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1.00$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD]$1.00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance,