#1
|
|||
|
|||
Macro to add periods into MAC address lists
I have a time consuming task of adding the MAC separator periods into a scanned list of MAC addresses. It is a requirement that I add the periods and am currently doing it manually. I know there are macros to automate things and I've made some using the record feature but I don't think that's going to cut it for this task. I'm thinking this is going to require VBA and I have pretty much no knowledge of VBA, the closest would be old school BASIC.
If there's a better way to do this task than manually I'd love some pointers and help. Thanks in advance! EDIT: The format of the document, depending on how many addresses I'm scanning in, is generally in three or four columns using the table function, so it looks like this: 0090c2e4e993 0090c2e8844f 0090c2e77aa9 0090c2f43de4 0090c2e66790 0090c2e03e4e 0090c2d45fe3 0090c2edd334 These need the periods inserted. The forum removes the spacing between columns so imagine a bit more spacing between them. |
#2
|
|||
|
|||
Provided each cell has 12 characters, this (while crude) should work:
Code:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey Dim oTbl As Word.Table Dim oCell As Cell Set oTbl = Selection.Tables(1) For Each oCell In oTbl.Range.Cells If Len(oCell.Range.Text) = 14 Then oCell.Range.Characters(5).InsertBefore "." oCell.Range.Characters(10).InsertBefore "." End If Next End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Shared file\macro & IP address | ibrahimaa | Excel Programming | 0 | 01-29-2012 09:08 AM |
Auto Forward Emails - Specific Time Periods Only | Dav | Outlook | 0 | 06-22-2011 12:03 PM |
Macro to replace From Address in Outlook | RlcZek113524 | Outlook | 0 | 06-08-2011 02:20 PM |
HELP! Outlook 2003 Address Books - multiple account address lists | ukmonkeynuts | Outlook | 0 | 06-01-2011 06:18 AM |
Putting periods/dots around the letter A | ph3iron | Word | 0 | 03-27-2010 06:11 AM |