Custom number format for displaying MAC addresses?

skiraly017

New Member
Joined
Oct 18, 2005
Messages
6
I'm trying to create an Excel sheet to display MAC addresses in the following format -

00:00:00:00:00:00

However. the characters can be either letters or numbers. I've modified the "hh:mm:ss" template to accomodate the format I need, but it will not recognize letters for the obvious reason. Is there a wildcard character that I could use in this format or has anyone created a format that would meet my needs? If I can pull this off, it could mean a promotion. Thanks in advance for any and all help.
 
Remove this line from the code

If Target.Column <> 1 Then Exit Sub 'column of interest

CAUTION!!!
Now all cells from row two down will be formatted that way regardless of what is entered. For instance "This is a test" becomes " Th:is:s :is:st"

You probably need to identify the cells where you want this format applied and name them. You can name non-contiguous cells by holding down the CTRL key while selecting.

Once they are named (say myRange ) insert an intersect statement in the code

Example
If Intersect(Target, Range("myRange")) Is Nothing Then Exit Sub

HTH

lenze
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Back again as the project I needed this for was suddenly dropped in my lap again. I modified the script Lenze provided on page one of this thread to meet my needs. The problem I havenow is copying and pasting. Here's my situation -

I am receiving raw data feed that list MAC addresses like this -

111111111111
222222222222
333333333333

If I try to copy and paste them from the data feed Excel sheet into my pre-formatted MAC address sheet, the pasted numbers do not format into the desired 11-11-11-11-11-11. However, if I do them one at a time they transfer and format just fine. Any ideas/suggestions?

TIA
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,115
Members
453,021
Latest member
Justyna P

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