I am using Excel 2007 (and writing code that 2003 users must be able to run)
I need help with VBA code. I have tried searching the forum and several books, but cannot determine which command to use. Here is the situation.
If an ActiveCell contains a comma, then I want the code to run a text-to-columns command (which I have already written). Otherwise the ActiveCell drops one row and continues.
Here is what I have so far (the text in red is where I am stuck. Everything else works):
NOTE: If the text-to-columns code above does not appear to work, it is because I reformatted it to fit in the code window above. In my program, it works well.
Thanks in advance for any help on the "If" line of code!
Charles
I need help with VBA code. I have tried searching the forum and several books, but cannot determine which command to use. Here is the situation.
If an ActiveCell contains a comma, then I want the code to run a text-to-columns command (which I have already written). Otherwise the ActiveCell drops one row and continues.
Here is what I have so far (the text in red is where I am stuck. Everything else works):
Code:
[COLOR="Red"]If ActiveCell.FormatConditions(",") Then[/COLOR]
Selection.TextToColumns Destination:=Range("S2") _
, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False _
, Tab:=False, Semicolon:=False, Comma:=True _
, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1)) _
, TrailingMinusNumbers:=True
Call Manage_Data
Else
ActiveCell.Offset(RowOffset:=1, ColumnOffset:=0).Select
End If
NOTE: If the text-to-columns code above does not appear to work, it is because I reformatted it to fit in the code window above. In my program, it works well.
Thanks in advance for any help on the "If" line of code!
Charles