alex0182828
Board Regular
- Joined
- Jun 20, 2012
- Messages
- 88
- Office Version
- 365
- Platform
- MacOS
Can anyone help me adjust my macro. I just need it so that any rows with Value 'Q' in Column A are skipped and not exported to the pipe seperated sheet ?
Thanks. Alex
Thanks. Alex
VBA Code:
Public Sub CharacterSV()
Const DELIMITER As String = "|"
Dim myRecord As Range
Dim myField As Range
Dim nFileNum As Long
Dim sOut As String
nFileNum = FreeFile
Open "orderswhoop.txt" For Output As #nFileNum
For Each myRecord In Range("A1:A" & _
Range("A" & Rows.Count).End(xlUp).Row)
With myRecord
For Each myField In Range(.Cells, _
Cells(.Row, Columns.Count).End(xlToLeft))
sOut = sOut & DELIMITER & myField.Text
Next myField
Print #nFileNum, Mid(sOut, 2)
sOut = Empty
End With
Next myRecord
Close #nFileNum
End Sub