Excel Function : BIN2HEX
Category
Engineering
Description
Converts a binary number to hexadecimal
Microsoft Excel Reference Page
https://support.office.com/en-us/article/BIN2HEX-function-0375e507-f5e5-4077-9af8-28d84f9f41cc
Syntax and Description of the BIN2HEX Excel Function
I have the following in Excel:
=BIN2HEX(D3*256+C3)
This takes a certain number and converts to HEX.
I'm trying to write a VBA macro to do this for me automatically. This is as far as I've got:
Private Sub ConvertBinaryHex()
Range("H3").Value = "=BIN2HEX(D3*256+C3)"
End Sub
I get the following error:
Unable to get the BIN2HEX property of the WorksheetFunction class
![]()
About BIN2HEX Excel Function
BIN2HEX(number, places) The BIN2HEX function converts a binary number to hexadecimal. The number argument is the binary number you want to convert. The places argument is the number of characters to use.