Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I'm trying to write some VBA code that will allow me to evaluate cells, find cells that include "#" somewhere in the string and duplicate the entry and modify the "#" to become a symbol. Here's an example. A list of items: Monkeys Cinnamon My#Number Dogs Would become: Monkeys Cinnamon My1Number My2Number Dogs I tried using the replace function, but I'm not having much luck with it. Any help would be greatly appreciated, Thanks in advance, Mike |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub DoctorData()
Dim i as long, cell as Range i = 1 for each cell in selection if instr(cell.Text,"#") then cell.Value = application.Substitute(cell.Text,"#",i) i = i + 1 end if Next End Sub -- Regards, Tom Ogilvy "Mike" wrote in message ... Hi all, I'm trying to write some VBA code that will allow me to evaluate cells, find cells that include "#" somewhere in the string and duplicate the entry and modify the "#" to become a symbol. Here's an example. A list of items: Monkeys Cinnamon My#Number Dogs Would become: Monkeys Cinnamon My1Number My2Number Dogs I tried using the replace function, but I'm not having much luck with it. Any help would be greatly appreciated, Thanks in advance, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically adding additional rows | Excel Discussion (Misc queries) | |||
Adding rows based on no of rows specified from a given position | Excel Worksheet Functions | |||
Date Formating and building character strings | Excel Discussion (Misc queries) | |||
testing for character strings within a cell | Excel Worksheet Functions | |||
Finding 13 character codes in text strings | Excel Worksheet Functions |