十进制到十六进制VBA [英] Decimal to Hexadecimal VBA

查看:405
本文介绍了十进制到十六进制VBA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在不使用十六进制函数和数组的情况下将十进制数转换为十六进制数?我将使用for循环,因为我需要将一组十进制数转换为十六进制数。

I was wondering how to convert decimal numbers to hexadecimal numbers without using the hex function and arrays? I will be using a for loop because I need to convert a set of decimal numbers to hexadecimal numbers.

感谢所有的帮助。

推荐答案

你有什么帮助在不使用十六进制函数的情况下获取十六进制值?从循环中调用以下内容,其中sNum是您要转换的数字。

What did you have in mind to get the hex value without using the hex function? Call the following from your loop where sNum is the number you wish to convert.

函数GetHex(sNum As Integer)字符串

    GetHex = Hex(sNum)

结束功能

Function GetHex(sNum As Integer) As String
    GetHex = Hex(sNum)
End Functionn


这篇关于十进制到十六进制VBA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆