I have searched and tried all the results from google but not luck.
I want the macro to save the file AND replace the current file AND not prompt me to save. I have all but the last part.
Sub OnBaseAutoFillPrep()
'
' OnBaseAutoFillPrep Macro
'
Dim i As Double
For i = 27 To 1000000
If Cells(i, 1).Value = Empty Then Exit For
Next
'
Columns("F:I").Select
Selection.Replace What:="-*", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Columns("J:J").Select
Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("L26").Select
Selection.AutoFill Destination:=Range("L26:L" & i - 1)
Range("L27:L" & i - 1).Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("K:K").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Rows("2:25").Select
Range("A25").Activate
Selection.Delete Shift:=xlUp
Range("A2").Select
ChDir "G:\Monthly Reports\Monthly Jul 2021 - Jun 2022\Templates"
ActiveWorkbook.SaveAs Filename:= _
"G:\Monthly Reports\Monthly Jul 2021 - Jun 2022\Templates\OnBase AutoFill FlatFile.xlsm" _
, CreateBackup:=True
Application.DisplayAlerts = True 'RESETS DISPLAY ALERTS
Application.Run "'OnBase AutoFill FlatFile.xlsm'!OutputQuotedCSV"
End Sub
Would appreciate any help.
Thanks
I want the macro to save the file AND replace the current file AND not prompt me to save. I have all but the last part.
Sub OnBaseAutoFillPrep()
'
' OnBaseAutoFillPrep Macro
'
Dim i As Double
For i = 27 To 1000000
If Cells(i, 1).Value = Empty Then Exit For
Next
'
Columns("F:I").Select
Selection.Replace What:="-*", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
Cells.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Columns("J:J").Select
Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("L26").Select
Selection.AutoFill Destination:=Range("L26:L" & i - 1)
Range("L27:L" & i - 1).Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("K:K").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Rows("2:25").Select
Range("A25").Activate
Selection.Delete Shift:=xlUp
Range("A2").Select
ChDir "G:\Monthly Reports\Monthly Jul 2021 - Jun 2022\Templates"
ActiveWorkbook.SaveAs Filename:= _
"G:\Monthly Reports\Monthly Jul 2021 - Jun 2022\Templates\OnBase AutoFill FlatFile.xlsm" _
, CreateBackup:=True
Application.DisplayAlerts = True 'RESETS DISPLAY ALERTS
Application.Run "'OnBase AutoFill FlatFile.xlsm'!OutputQuotedCSV"
End Sub
Would appreciate any help.
Thanks