Board index » Excel » searching for slashes "/" in cells
|
DerrickBailes
|
|
DerrickBailes
|
searching for slashes "/" in cells
Excel132
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
Registered User |
Thu Jul 26 18:40:31 CDT 2007
Re: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: Quote
Dave Peterson - |
