ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format Cells for binary or hexadecimal numbers (https://www.excelbanter.com/excel-programming/396264-format-cells-binary-hexadecimal-numbers.html)

Cheryl

Format Cells for binary or hexadecimal numbers
 
Is it possible to enter a number in decimal but format the cell to display
the number in either binary or hexacecimal format?

I am running Microsoft Office Excel 2003 (11.8117.8122) SP2

Thank you,


Gary''s Student

Format Cells for binary or hexadecimal numbers
 
Rather than format, use the DEC2HEX() function
--
Gary''s Student - gsnu200739


"Cheryl" wrote:

Is it possible to enter a number in decimal but format the cell to display
the number in either binary or hexacecimal format?

I am running Microsoft Office Excel 2003 (11.8117.8122) SP2

Thank you,


Cheryl

Format Cells for binary or hexadecimal numbers
 
Yes, but that requires using a second cell, doesn't it, which makes the
spreadsheet bigger and messier, something I was hoping to avoid.

"Gary''s Student" wrote:

Rather than format, use the DEC2HEX() function
--
Gary''s Student - gsnu200739


"Cheryl" wrote:

Is it possible to enter a number in decimal but format the cell to display
the number in either binary or hexacecimal format?

I am running Microsoft Office Excel 2003 (11.8117.8122) SP2

Thank you,


Gary''s Student

Format Cells for binary or hexadecimal numbers
 
I don't know of a way to format a number to appear as hex. Alternatives are
to run a macro like:

Sub hexit()
'
' gsnuxx
'
With Selection
V = .Value
.Formula = "=dec2hex(" & V & ")"
.Value = .Value
End With
End Sub


after the data has been entered or to use an Event macro to call hexit
automatically upon entry of data.
--
Gary''s Student - gsnu200739


"Cheryl" wrote:

Yes, but that requires using a second cell, doesn't it, which makes the
spreadsheet bigger and messier, something I was hoping to avoid.

"Gary''s Student" wrote:

Rather than format, use the DEC2HEX() function
--
Gary''s Student - gsnu200739


"Cheryl" wrote:

Is it possible to enter a number in decimal but format the cell to display
the number in either binary or hexacecimal format?

I am running Microsoft Office Excel 2003 (11.8117.8122) SP2

Thank you,



All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com