Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
searching for slashes "/" in cells
I need someone to fill in the blanks:
Sub AddNodeCommas() For each C in Intersect Range("D2:D122") if c =*"/" substitute(c,c,c&",") Else Next End Sub What I want to do is add a comma to the end of the text in the cells if the cell does not contain a / (forward slash). I got a syntax error in here. this time I didn't forget the "'s tia, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
searching for slashes "/" in cells
Maybe...
Option Explicit Sub AddNodeCommas2() Dim SlashPos As Long Dim myCell As Range For Each myCell In ActiveSheet.Range("d2:d122").Cells If myCell.Value = "" Then 'skip it??? Else SlashPos = InStr(1, myCell.Value, "/", vbTextCompare) If SlashPos 0 Then '/ was found, so skip it Else myCell.Value = myCell.Value & "," End If End If Next myCell End Sub Janis wrote: I need someone to fill in the blanks: Sub AddNodeCommas() For each C in Intersect Range("D2:D122") if c =*"/" substitute(c,c,c&",") Else Next End Sub What I want to do is add a comma to the end of the text in the cells if the cell does not contain a / (forward slash). I got a syntax error in here. this time I didn't forget the "'s tia, -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Searching for a "LESS THAN"" amount within a sheet! | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
searching for cells that "contain" certain value | Excel Discussion (Misc queries) | |||
Can you "duplicate" "copy" listboxes and code to multiple cells? | Excel Programming | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming |