View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Excel 2007 VBA: Convert laaaaarge number to Hex

Both! VBA raises the error I posted. Wks returns #VALUE!
Here's the code


Okay, I think I know what is happening... the value in the cell is not a
integer value, it is a value in scientific notation (3.77198E+16) which is
what is passed into the function... the function does not know what to do
with the decimal point or the E, so it errors out. Either enter the numbers
with an apostrophe in front of them or change the cell format to Text and
type the number in so that it hold all of its digits (you might have missed
that the original number 37719831058777893 was changed to 37719831058777800
because of Excel's precision display limitations).

Rick Rothstein (MVP - Excel)