Dim FileNum As Integer
Dim s As String
Dim sTemp As String
Dim d As String
Dim m As String
Dim nr As Long
Dim l As Long
Dim nc As Integer
Dim tFile As String
Dim oFile As String
Dim sLength As Integer
Dim fieldError As Boolean
Dim FSO As Object
Dim rSlt As String
Dim mNa As String
Dim InputValue As String
Dim srchRng As Range
Dim Lastrow As Integer
MsgBox ("start")
tFile = ActiveWorkbook.Path & "\vmss_batch_search_file_temp.csv"
Set FSO = CreateObject("Scripting.FileSystemObject")
mNa = Left(ActiveWorkbook.FullName, Len(ActiveWorkbook.FullName) - 4)
If FSO.FileExists(mNa) Then
oFile = FSO.GetBaseName(mNa)
oFile = mNa & "csv"
Else
oFile = mNa & "csv"
End If
If Dir(tFile) <> "" Then
Kill tFile
End If
With Worksheets("Batch")
nr = .Range("A65536").End(xlUp).row
'MsgBox (nr)
FileNum = FreeFile
Open tFile For Output As #FileNum
For l = 2 To nr
' If nc = 44 Then
For nc = 1 To 71
fieldError = False
sTemp = ""
sTemp = .Cells(l, nc).Value
sTemp = Replace(sTemp, Chr(160), " ")
'MsgBox (sTemp)
'-o-o-o- Validate Action Indicator Type -o-o-o-
If nc = 1 And sTemp <> "S" And sTemp <> "GS" And sTemp <> "" Then
MsgBox ("Invalid Action Indicator Record Type in Row " & l)
fieldError = True
Exit For
End If
If nc = 16 And sTemp <> "" Then
sTemp = getterCode(sTemp)
If sTemp = "notfound" Then
MsgBox ("Invalid Terminate Code in Row " & l)
fieldError = True
Exit For
End If
End If
If the col cell is empty , then need to provide pop up to fill the empty cell and once all the empty cells are filled ..run the macros and create output file
Dim s As String
Dim sTemp As String
Dim d As String
Dim m As String
Dim nr As Long
Dim l As Long
Dim nc As Integer
Dim tFile As String
Dim oFile As String
Dim sLength As Integer
Dim fieldError As Boolean
Dim FSO As Object
Dim rSlt As String
Dim mNa As String
Dim InputValue As String
Dim srchRng As Range
Dim Lastrow As Integer
MsgBox ("start")
tFile = ActiveWorkbook.Path & "\vmss_batch_search_file_temp.csv"
Set FSO = CreateObject("Scripting.FileSystemObject")
mNa = Left(ActiveWorkbook.FullName, Len(ActiveWorkbook.FullName) - 4)
If FSO.FileExists(mNa) Then
oFile = FSO.GetBaseName(mNa)
oFile = mNa & "csv"
Else
oFile = mNa & "csv"
End If
If Dir(tFile) <> "" Then
Kill tFile
End If
With Worksheets("Batch")
nr = .Range("A65536").End(xlUp).row
'MsgBox (nr)
FileNum = FreeFile
Open tFile For Output As #FileNum
For l = 2 To nr
' If nc = 44 Then
For nc = 1 To 71
fieldError = False
sTemp = ""
sTemp = .Cells(l, nc).Value
sTemp = Replace(sTemp, Chr(160), " ")
'MsgBox (sTemp)
'-o-o-o- Validate Action Indicator Type -o-o-o-
If nc = 1 And sTemp <> "S" And sTemp <> "GS" And sTemp <> "" Then
MsgBox ("Invalid Action Indicator Record Type in Row " & l)
fieldError = True
Exit For
End If
If nc = 16 And sTemp <> "" Then
sTemp = getterCode(sTemp)
If sTemp = "notfound" Then
MsgBox ("Invalid Terminate Code in Row " & l)
fieldError = True
Exit For
End If
End If
If the col cell is empty , then need to provide pop up to fill the empty cell and once all the empty cells are filled ..run the macros and create output file