Converting String to Hex in Excel VBA
问题 I need to convert strings to hexadecimals in my Excel VBA macro. I tried: Dim val As String val = "10" Dim hexVal As Integer hexVal = Convert.ToInt32(val, 16) but Convert.ToInt32(val, 16) does not work, I'm guessing because it's not VB.NET? Anyway, I can use CInt(val) to convert a string to an integer but if I have the string representation of a hex value, e.g. "3366CC", how do I convert it to hex so that I can perform hex calculations on it? 回答1: In VBA you need to mess about with the &H