PC Review


Reply
Thread Tools Rate Thread

Convert numbers to HEX

 
 
Madiya
Guest
Posts: n/a
 
      20th Sep 2008
Hi,
I am using excel to open a web page with a url.
All are fine except building a url where I need to convert contents of
cell to HEX.
All cell contents will be 10 digit numbers.
I have a url which will be appended with this HAX at the end.

Is there any way to convert this 10 digit numbers to HEX by VBA?

Regards,
Madiya
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      20th Sep 2008
Hi,

It's done with

mynum = Hex(mynum)

But in your partiular case we could do with seeing some examples of the
string that contains the decimal number.

Mike

"Madiya" wrote:

> Hi,
> I am using excel to open a web page with a url.
> All are fine except building a url where I need to convert contents of
> cell to HEX.
> All cell contents will be 10 digit numbers.
> I have a url which will be appended with this HAX at the end.
>
> Is there any way to convert this 10 digit numbers to HEX by VBA?
>
> Regards,
> Madiya
>

 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      20th Sep 2008
Use the HEX function in VBA

e.g. myHex = Hex(1234567890)



--

Regards,
Nigel
(E-Mail Removed)



"Madiya" <(E-Mail Removed)> wrote in message
news:8d312a94-fed7-422f-a6f3-(E-Mail Removed)...
> Hi,
> I am using excel to open a web page with a url.
> All are fine except building a url where I need to convert contents of
> cell to HEX.
> All cell contents will be 10 digit numbers.
> I have a url which will be appended with this HAX at the end.
>
> Is there any way to convert this 10 digit numbers to HEX by VBA?
>
> Regards,
> Madiya


 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      20th Sep 2008
The Hex function as suggested is probably OK for your needs. But to be on
the safe side post an example of a Hex code and the equivalent number, just
in case the bit and or byte order is reversed.

Regards,
Peter T

"Madiya" <(E-Mail Removed)> wrote in message
news:8d312a94-fed7-422f-a6f3-(E-Mail Removed)...
> Hi,
> I am using excel to open a web page with a url.
> All are fine except building a url where I need to convert contents of
> cell to HEX.
> All cell contents will be 10 digit numbers.
> I have a url which will be appended with this HAX at the end.
>
> Is there any way to convert this 10 digit numbers to HEX by VBA?
>
> Regards,
> Madiya



 
Reply With Quote
 
Madiya
Guest
Posts: n/a
 
      23rd Sep 2008
On Sep 20, 3:07*pm, "Peter T" <peter_t@discussions> wrote:
> TheHexfunction as suggested is probably OK for your needs. But to be on
> the safe side post an example of aHexcode and the equivalent number, just
> in case the bit and or byte order is reversed.
>
> Regards,
> Peter T
>
> "Madiya" <madiya...@yahoo.co.uk> wrote in message
>
> news:8d312a94-fed7-422f-a6f3-(E-Mail Removed)...
>
>
>
> > Hi,
> > I am using excel to open a web page with a url.
> > All are fine except building a url where I need to convert contents of
> > cell toHEX.
> > All cell contents will be 10 digit numbers.
> > I have a url which will be appended with this HAX at the end.

>
> > Is there any way to convert this 10 digit numbers toHEXby VBA?

>
> > Regards,
> > Madiya- Hide quoted text -

>
> - Show quoted text -


Yes, You are right.
I am getting error in VBA function Hex(1234567890) .
Error is "Runtime error '6' ", Over Flow.

Here is an example of input and output reqd.
input 9320545500
output EDD7EA6A0CDC5CA7212187EB854408ADF73E7F7BA2FF95BA

input 9320545566
output 695B91538F72D3B2F0BED374FA4E02A9634A1C4CE9292966

Pl help.

Regards,
Madiya
 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      23rd Sep 2008
You can get 10 digit hex numbers with the Hex2Dec function in Analysis Tool
Pack addin (or the version for use with VBA).

Input 9320545500
Output 22B8C3CDC

input 9320545566
output 22B8C3D1E

Note Hex2Dec returns a different construct to VBA's Hex depending on the
number.

Those 48-char Hex numbers in theory represent a number somewhere between
3.9E+56 to 3.14E+57

However I kind of assume they represent some sort of code, you'd need to
give more information.

Regards,
Peter T


"Madiya" <(E-Mail Removed)> wrote in message

Yes, You are right.
I am getting error in VBA function Hex(1234567890) .
Error is "Runtime error '6' ", Over Flow.

Here is an example of input and output reqd.
input 9320545500
output EDD7EA6A0CDC5CA7212187EB854408ADF73E7F7BA2FF95BA

input 9320545566
output 695B91538F72D3B2F0BED374FA4E02A9634A1C4CE9292966

Pl help.

Regards,
Madiya




 
Reply With Quote
 
Madiya
Guest
Posts: n/a
 
      24th Sep 2008
On Sep 23, 6:17*pm, "Peter T" <peter_t@discussions> wrote:
> You can get 10 digit hex numbers with the Hex2Dec function in Analysis Tool
> Pack addin (or the version for use with VBA).
>
> Input 9320545500
> Output 22B8C3CDC
>
> input 9320545566
> output 22B8C3D1E
>
> Note Hex2Dec returns a different construct to VBA's Hex depending on the
> number.
>
> Those 48-char Hex numbers in theory represent a number somewhere between
> 3.9E+56 to 3.14E+57
>
> However I kind of assume they represent some sort of code, you'd need to
> give more information.
>
> Regards,
> Peter T
>
> "Madiya" <madiya...@yahoo.co.uk> wrote in message
>
> Yes, You are right.
> I am getting error in VBA function Hex(1234567890) .
> Error is "Runtime error '6' ", Over Flow.
>
> Here is an example of input and output reqd.
> input 9320545500
> output EDD7EA6A0CDC5CA7212187EB854408ADF73E7F7BA2FF95BA
>
> input 9320545566
> output 695B91538F72D3B2F0BED374FA4E02A9634A1C4CE9292966
>
> Pl help.
>
> Regards,
> Madiya


Thanks Peter.
But I have no idea what code it is. In fact I have derived this hex
from the resultent url of the web page
We have to enter the 10 digit no in the text box and click submit
button.
A new page loaded in browser will show related details with the above
output appended at the end of the url.

Shell I post the html source code of the page? Can that be of any
help?

Regards,
Madiya
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I convert numbers stored as text back to numbers in MS Access CUserM Microsoft Access Queries 7 20th Jun 2008 08:12 PM
Convert numbers stored as text to numbers errors after loading data in jobs Microsoft Excel Programming 2 28th Mar 2007 02:57 AM
Excel 2002 : Convert Positive Numbers to Negative Numbers ? =?Utf-8?B?TXIuIExvdw==?= Microsoft Excel Misc 2 6th Nov 2006 03:30 PM
convert negative numbers to positive numbers and vice versa =?Utf-8?B?YmlsbCBncmFz?= Microsoft Excel Worksheet Functions 4 7th Dec 2005 01:39 AM
Convert automatic numbers to real numbers and vice versa =?Utf-8?B?UGhpbCBNdW5jaw==?= Microsoft Word Document Management 1 3rd May 2005 02:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:09 AM.