I have data coming in that looks like:
<table border="0" cellpadding="0" cellspacing="0" width="147"><colgroup><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:694;width:14pt" width="19"> <col style="width:48pt" width="64"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td style="height:15.0pt;width:48pt" height="20" width="64">Desire:</td> <td style="width:14pt" width="19">
</td> <td style="width:48pt" width="64">TEXT:</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0008201</td> <td class="xl65">
</td> <td class="xl65">820a</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0001112</td> <td class="xl65">
</td> <td class="xl65">111b</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0001223</td> <td class="xl65">
</td> <td class="xl65">122c</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0001334</td> <td class="xl65">
</td> <td class="xl65">133d</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0001445</td> <td class="xl65">
</td> <td class="xl65">144e</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0000056</td> <td class="xl65">
</td> <td class="xl65">5f</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0949867</td> <td class="xl65">
</td> <td class="xl65">94986g</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0949878</td> <td class="xl65">
</td> <td class="xl65">94987h</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20" align="right">-100011</td> <td class="xl66">
</td> <td class="xl65">10001j</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20" align="right">-010002</td> <td class="xl66">
</td> <td class="xl65">1000k</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20" align="right">-000003</td> <td class="xl66">
</td> <td class="xl65">0l</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20" align="right">-000110</td> <td class="xl66">
</td> <td class="xl65">11}</td> </tr> </tbody></table>
Where:
{=0
a=1
b=2
c=3
d=4
}=-
j=-1
k=-2
l=-3
m=-4
I've got the vba figured out for the positive translations, but i cannot figure out how to change the cell to negative. (Again, I need help making it negative and replacing the character at the end. I can only figure out how to replace the character and replace the font to red...)
this is what I have so far:
For Each c In Range("a2", Range("a" & Rows.Count).End(xlUp))
H = c
For a = 1 To Len(H)
If Not IsNumeric(Mid(H, a, 1)) Then
Select Case Mid(LCase(H), a, 1)
Case "a"
Mid(H, a, 1) = "1"
Case "b"
Mid(H, a, 1) = "2"
Case "c"
Mid(H, a, 1) = "3"
Case "d"
Mid(H, a, 1) = "4"
Case "e"
Mid(H, a, 1) = "5"
Case "f"
Mid(H, a, 1) = "6"
Case "g"
Mid(H, a, 1) = "7"
Case "h"
Mid(H, a, 1) = "8"
Case "i"
Mid(H, a, 1) = "9"
Case "{"
Mid(H, a, 1) = "0"
Case "}"
'NONE OF THESE WORK:
' c.Value = "'-'" & c.Value
'c.Font.ColorIndex = 3
' c.Value.InsertAfter Chr(1), "abc"
'c.Value = Left(c, 2) = "-1" & Mid(H, a, 1) = "0"
' c.Formula = ActiveCell.Value * -1
' c.Value = Evaluate(c.Address & "*-1")
'value ("-1)").Operation:=xlMultiply("-1")
<table border="0" cellpadding="0" cellspacing="0" width="147"><colgroup><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:694;width:14pt" width="19"> <col style="width:48pt" width="64"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td style="height:15.0pt;width:48pt" height="20" width="64">Desire:</td> <td style="width:14pt" width="19">
</td> <td style="width:48pt" width="64">TEXT:</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0008201</td> <td class="xl65">
</td> <td class="xl65">820a</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0001112</td> <td class="xl65">
</td> <td class="xl65">111b</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0001223</td> <td class="xl65">
</td> <td class="xl65">122c</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0001334</td> <td class="xl65">
</td> <td class="xl65">133d</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0001445</td> <td class="xl65">
</td> <td class="xl65">144e</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0000056</td> <td class="xl65">
</td> <td class="xl65">5f</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0949867</td> <td class="xl65">
</td> <td class="xl65">94986g</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20" align="right">0949878</td> <td class="xl65">
</td> <td class="xl65">94987h</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20" align="right">-100011</td> <td class="xl66">
</td> <td class="xl65">10001j</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20" align="right">-010002</td> <td class="xl66">
</td> <td class="xl65">1000k</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20" align="right">-000003</td> <td class="xl66">
</td> <td class="xl65">0l</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl66" style="height:15.0pt" height="20" align="right">-000110</td> <td class="xl66">
</td> <td class="xl65">11}</td> </tr> </tbody></table>
Where:
{=0
a=1
b=2
c=3
d=4
}=-
j=-1
k=-2
l=-3
m=-4
I've got the vba figured out for the positive translations, but i cannot figure out how to change the cell to negative. (Again, I need help making it negative and replacing the character at the end. I can only figure out how to replace the character and replace the font to red...)
this is what I have so far:
For Each c In Range("a2", Range("a" & Rows.Count).End(xlUp))
H = c
For a = 1 To Len(H)
If Not IsNumeric(Mid(H, a, 1)) Then
Select Case Mid(LCase(H), a, 1)
Case "a"
Mid(H, a, 1) = "1"
Case "b"
Mid(H, a, 1) = "2"
Case "c"
Mid(H, a, 1) = "3"
Case "d"
Mid(H, a, 1) = "4"
Case "e"
Mid(H, a, 1) = "5"
Case "f"
Mid(H, a, 1) = "6"
Case "g"
Mid(H, a, 1) = "7"
Case "h"
Mid(H, a, 1) = "8"
Case "i"
Mid(H, a, 1) = "9"
Case "{"
Mid(H, a, 1) = "0"
Case "}"
'NONE OF THESE WORK:
' c.Value = "'-'" & c.Value
'c.Font.ColorIndex = 3
' c.Value.InsertAfter Chr(1), "abc"
'c.Value = Left(c, 2) = "-1" & Mid(H, a, 1) = "0"
' c.Formula = ActiveCell.Value * -1
' c.Value = Evaluate(c.Address & "*-1")
'value ("-1)").Operation:=xlMultiply("-1")