I have the following code I am trying to remove the limiter that blocks the file from reporting if alpha but I need the code to still skip the first 3 rows of my excel form and NOT output the data from the first three rows to the .txt file. Is this possible?
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Const DELIMITER As String = "|"
Dim varCol As Variant
Dim strOutput As String
Dim strTemp As String
Dim i As Long
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If IsNumeric(Cells(i, "A").Value) And Len(Cells(i, "A").Value) > 0 Then
strTemp = vbNullString
For Each varCol In Array("A", "C", "E", "L", "Q", "S", "X", "Z", "AC", "AE", "AG")
Select Case (InStr(Cells(i, varCol).Text, "|") > 0)
Case True: strTemp = strTemp & DELIMITER & """" & Cells(i, varCol).Text & """"
Case Else: strTemp = strTemp & DELIMITER & Cells(i, varCol).Text
End Select
Next varCol
strTemp = Mid(strTemp, Len(DELIMITER) + 1)
If Len(strOutput) = 0 Then strOutput = strTemp Else strOutput = strOutput & vbCrLf & strTemp
End If
Next i
If Len(strOutput) > 0 Then
Close #1
Open "\\mdappc02\mtstats\STAGED\10_EOM\EOMStats.txt" For Output As #1
Print #1, strOutput
Close #1
End If
End Sub
Bookmarks