473,320 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Convert Hex number to text

subedimite
Here I am with another question being a very new VBA user.


I have this scenario to work with: I would think this is fairly common routine of work for VBA.
I have a string of hex contents as characters such as

String1 = “3B F0 96 00 FF C0 0A 31 FE 4D D1”

I need to do some calculation with these and then update a table with the text value. For example, A sum of all these.

Hence my first steps would be

1. Convert the whole string to number one by one in a loop.
2. Do the calculation (Add all the numbers)
3. Convert the total value( number) into Hex with the Hex function.
4. Convet the Hex value back to text, i.e if it 9F, then convert to 9F text
5. Update the table with the 9F.

I found a function to convert string to number and then to Hex and hence I think I can handle all the steps apart from step 4.

Could you please let me know if there is any function available that will convert Hex number to text or string.
Apr 19 '10 #1

✓ answered by NeoPa

The function Hex() is actually all you need. It will take values expressed as ordinary decimal just as well as hex values. Debug.Print is simply the part that displays the value for you to check it. It is not really part of the solution as such.

4 7130
According to the other thread all I need to do is this

Debug.Print Hex$(Val(&HHexValue))

So it should all be fine:


Cheers:
Apr 20 '10 #2
NeoPa
32,556 Expert Mod 16PB
The function Hex() is actually all you need. It will take values expressed as ordinary decimal just as well as hex values. Debug.Print is simply the part that displays the value for you to check it. It is not really part of the solution as such.
Apr 20 '10 #3
Hi Thanks for that , although became pretty later to thank it:). It is all fine for me:)
May 18 '10 #4
NeoPa
32,556 Expert Mod 16PB
No worries. Glad you're sorted :)
May 18 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: aevans1108 | last post by:
expanding this message to microsoft.public.dotnet.xml Greetings Please direct me to the right group if this is an inappropriate place to post this question. Thanks. I want to format a...
2
by: Phil Stanton | last post by:
When designing a new form or report, the Default ForeColor is often something like -2147483640 which is the colour of Windows text (possibly black) and the default backColor is -2147483643...
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
6
by: MrKrich | last post by:
I want to convert Hexadecimal or normal integer to Binary. Does VB.Net has function to do that? I only found Hex function that convert normal integer to Hexadecimal.
17
by: Terry Jolly | last post by:
New to C# ---- How do I convert a Date to int? In VB6: Dim lDate as long lDate = CLng(Date) In C#
30
by: ceeques | last post by:
Hi I am a novice in C. Could you guys help me solve this problem - I need to convert integer(and /short) to string without using sprintf (I dont have standard libray stdio.h). for...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does 1+1 equal 11? or How do I convert a string to a number?...
7
by: elliotng.ee | last post by:
I have a text file that contains a header 32-bit binary. For example, the text file could be: %%This is the input text %%test.txt Date: Tue Dec 26 14:03:35 2006...
3
by: mrajanikrishna | last post by:
Hi Friends, I am accepting a number from the user entered in a textbox. I want to assign to a variable in my code and assignt this to that variable. double num1 = (double)txtNum1.text; ...
5
by: Elainie | last post by:
I would like to convert data numbers to text.... i.e. 1 = Inactive 2 = Due 3 = Received 4 = Problems 5 = Cleared Their is numbers in the fields at the moment but they need to be converted to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.