Stephen_IV
Well-known Member
- Joined
- Mar 17, 2003
- Messages
- 1,180
- Office Version
- 365
- 2019
- Platform
- Windows
Good afternoon,
Please see data below. I am looking for some VBA code that will highlight an area if it does not have a value in it.
In Column E if the first 2 Alpha characters do not start with "MA" or "EN" then highlight the area, if not leave blank.
<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC ;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC ;
}
.tableizer-table th {
background-color: #104E8B ;
color: #FFF ;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th>ID</th><th>Name</th><th>Year</th><th>School</th><th>Course</th></tr></thead><tbody>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>7777777</td><td>xxxxxxx</td><td>17-18</td><td>111</td><td>AD012YPLGE</td></tr>
<tr><td>7777777</td><td>xxxxxxx</td><td>17-18</td><td>111</td><td>SC215YMAMA</td></tr>
<tr><td>7777777</td><td>xxxxxxx</td><td>17-18</td><td>111</td><td>MA301YTDCL</td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>CS121YMAMA</td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>EN401YMAMA</td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>PE100YTDGE</td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>AD012YPLGE</td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>AD014YPLGE</td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>ID102YTDAP</td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>WL103YMAMA</td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>PE100YTDGE</td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>SC420YMAMA</td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>AD011YPLGE</td></tr>
</tbody></table>
Please see data below. I am looking for some VBA code that will highlight an area if it does not have a value in it.
In Column E if the first 2 Alpha characters do not start with "MA" or "EN" then highlight the area, if not leave blank.
<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC ;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC ;
}
.tableizer-table th {
background-color: #104E8B ;
color: #FFF ;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th>ID</th><th>Name</th><th>Year</th><th>School</th><th>Course</th></tr></thead><tbody>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>7777777</td><td>xxxxxxx</td><td>17-18</td><td>111</td><td>AD012YPLGE</td></tr>
<tr><td>7777777</td><td>xxxxxxx</td><td>17-18</td><td>111</td><td>SC215YMAMA</td></tr>
<tr><td>7777777</td><td>xxxxxxx</td><td>17-18</td><td>111</td><td>MA301YTDCL</td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>CS121YMAMA</td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>EN401YMAMA</td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>PE100YTDGE</td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>AD012YPLGE</td></tr>
<tr><td>8888888</td><td>yyyyyyy</td><td>17-18</td><td>222</td><td>AD014YPLGE</td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>ID102YTDAP</td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>WL103YMAMA</td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>PE100YTDGE</td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>SC420YMAMA</td></tr>
<tr bgcolor="#FF0000"><td>9999999</td><td>zzzzzzz</td><td>17-18</td><td>333</td><td>AD011YPLGE</td></tr>
</tbody></table>