2007 Excel Hexadecimal XOR calculation

Sparky81

New Member
Joined
Jun 14, 2011
Messages
7
I have been trying to figure out how to do XOR calculations in Excel instead of using windows calculator. Such as 1A xor F1 = EB.

I have tried a few variations of modules within VBA, set references to atpvbaen.xls, but I am still getting

Compile Error:
Sub or Function not defined

Any ideas on how to do this? I am a newbie on writing codes so bear with me.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Xor is a native operator

Code:
myLong = &H1A Xor &HF1
msgbox hex(myLong)
 
Upvote 0
=tester(C19,D19)

Code:
Public Function tester(r1 As Range, r2 As Range) As Double

tester = r1.Value Xor r2.Value
End Function
(put in a module)
 
Upvote 0
That works. Will I always have to use "&H" or is there a work around?

This will start with a decimal number and will eventually spit out a string of hexadecimal. If I can make it to where the single decimal number is input and the rest is automated it would be perfect.

Thanks for your help!
 
Upvote 0
I can have them do that. the cells its actually pulling from were going to be hidden but I can show them and have people add &H to the front end of the number. Just trying to see if there was a work around. Again thanks!
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,223
Members
452,896
Latest member
IGT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top