Configuration: Windows XP Firefox 2.0.0.11
Bill,
Look into the vb functions Mid and Len, this will allow you to select the right char. Example: val = "1AALIBOLTS10000" tempval = mid(val,1,1) 'Mid will extract from val starting at pos 1 for a lenght of 1 the return value will be 1 'Select your cell 'Activecell text set = "its a " & tempva |
the code for your question will look something like this.
Dim mycheck as boolean endrange = range("A65000").end(xlUp).row for i = 1 to endrange mycheck = range("A" & i).value Like "1*" if mycheck = true then range("B" & i).value="Its a One" end if my2check = range("A" & i).value Like "?c*" if my2check = true then range("E" & i).value="Its a C" end if next i Hope it helps. :) |
Résultats pour Excel vba if first char of cell is 1 then
Résultats pour Excel vba if first char of cell is 1 then
Résultats pour Excel vba if first char of cell is 1 then
Résultats pour Excel vba if first char of cell is 1 then