Macro that generates 8 digit random hexa on a given input

parvezse16

New Member
Joined
Sep 5, 2021
Messages
14
Office Version
  1. 2013
Platform
  1. Windows
Hi there,
I'm looking for a macro which generate an 8 digit hexa number on a given input numbers. But before generate a random hexa-number, check if particular input is already in a cell (for example row 12) in column A, corresponding to that cell value (cell 12)in column B will be added in blank cell of both columns other wise generate the hexa-number and add in blank cells with input in separate columns.
Like below Mini-Spreadsheet, If I insert a new input 200321 first it will check the value in Input Cell whether that value exist, If exist than copy corresponding Hexa-Code "MDI93N88" and add it into row 3 of Hexa-Code, and the input value "200321" added to row 3 of Input Column.


InputHexa-Code
200321​
MDI93N88
91220​
HD737J93
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Why you don't Use Dec2Hex function.
Excel Formula:
=DEC2HEX(45,8)
you can change 45 with cell address or another number.
And 8 is number of digits you want.
 
Upvote 0
Thanks
Why you don't Use Dec2Hex function.
Excel Formula:
=DEC2HEX(45,8)
you can change 45 with cell address or another number.
And 8 is number of digits you want.
But how about check If, there exist a value than why should I generate a number rather I have to add corresponding value
Like, I said here
If I insert a new input 200321 first it will check the value in Input Cell whether that value exist, If exist than copy corresponding Hexa-Code "MDI93N88" and add it into row 3 of Hexa-Code, and the input value "200321" added to row 3 of Input Column.


InputHexa-Code
200321​
MDI93N88
91220​
HD737J93
200321MDI93N88
 
Upvote 0
No need to Check. it show real Hex value correspond with number and it is always same.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,241
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top