Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have written the Macro below in Excel that returns the generic # for
number and @ for a letter e.g. 'abc123' would be '@@@###': Public Function Kabi_it(thing) Dim work1 For i = 1 To Len(thing) If (Asc(Mid(thing, i, 1)) 96) And (Asc(Mid(thing, i, 1)) < 123) Then work1 = work1 & "@" ElseIf (Asc(Mid(thing, i, 1)) 64) And (Asc(Mid(thing, i, 1)) < 91) Then work1 = work1 & "@" Else work1 = work1 & "#" End If Next Kabi_it = work1 End Function I have two questions: 1) Is there a simpler elegant way of acheiving a similar result; and 2) I want to narrow this down so that if the first a string contains 'O', 'D' or '0', these are ignored and left the same e.g. 'abcd1023o' would be '@@@d#0##o'. Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |