How do I change hexadecimal number to binary in excel

  • Thread starter Thread starter Guest
  • Start date Start date
If you want to do it digit by digit you could do something like this

In a 'normal' module:

'***********************************************
Function hextobin(byval hexa as string)

Select Case hexa

Case "0": hextobin = "0000"
Case "1": hextobin = "0001"
Case "2": hextobin = "0010"
Case "3": hextobin = "0011"
'continue until last hexa digit....
'
'
case "F": hextobin = "1111"
End Select

End function

'***********************************************
 
Rather than rolling your own, use Excel's HEX2BIN() function. You must have
the Analysis Toolpak add-in checked to make this available
 
Thanks Duke!
I know the Hex2bin function...
I was actually trying to 'spread' some example to use the powerful VBA
capabilities.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top