Insert Value and re-run the macro

mm07

New Member
Joined
May 8, 2021
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
  2. MacOS
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
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,215,534
Messages
6,125,374
Members
449,221
Latest member
chriscavsib

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top