Stephen_IV
Well-known Member
- Joined
- Mar 17, 2003
- Messages
- 1,176
- Office Version
- 365
- 2019
- Platform
- Windows
I have some code and it works for returning single values but I need to modify it to bring back multiple results
<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>2000 ARLINGTON OAKS DR S; MOBILE Alabama 36695-8739</th><th>AL</th></tr></thead><tbody>
<tr><td>978 VIRGINIA ST SABETHA Kansas 66534-2431</td><td>KS</td></tr>
<tr><td>5200 WILSHIRE RD CHESAPEAKE Virginia 23321-3280</td><td>VA</td></tr>
<tr><td>1952 East Main St Bridgeport Connecticut 06610, 44 Brooks St Woodstock Virginia</td><td>CT, VA</td></tr>
<tr><td>1943 Roosevelt St Wichita Kansas, 441 West Ave. Auburn Alabama</td><td>KA, AL</td></tr>
</tbody></table>
Code:
Public Function States(s As String) As String
Select Case True
Case InStr(s, "Alabama"): States = "AL"
Case InStr(s, "Kansas"): States = "KS"
Case InStr(s, "Connecticut"): States = "CT"
Case InStr(s, "Virginia"): States = "VA"
Case Else
End Select
End Function
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>2000 ARLINGTON OAKS DR S; MOBILE Alabama 36695-8739</th><th>AL</th></tr></thead><tbody>
<tr><td>978 VIRGINIA ST SABETHA Kansas 66534-2431</td><td>KS</td></tr>
<tr><td>5200 WILSHIRE RD CHESAPEAKE Virginia 23321-3280</td><td>VA</td></tr>
<tr><td>1952 East Main St Bridgeport Connecticut 06610, 44 Brooks St Woodstock Virginia</td><td>CT, VA</td></tr>
<tr><td>1943 Roosevelt St Wichita Kansas, 441 West Ave. Auburn Alabama</td><td>KA, AL</td></tr>
</tbody></table>