gruntingmonkey
Active Member
- Joined
- Mar 6, 2008
- Messages
- 427
- Office Version
-
- 365
- Platform
-
- Windows
Hello,
Am trying to to get to the end of a macro by using the call function but its not working, does anyone have any ideas
Sub Save_File1()
Dim File1 As String
Dim File1dest As String
File1 = Worksheets("utilities").Cells(14, 13).Value
File1dest = Worksheets("utilities").Cells(14, 14).Value
Worksheets("utilities").Select
Worksheets("utilities").Activate
If Cells(14, 5).Value = "Y" Then
Workbooks.Open Filename:=(File1)
ActiveWorkbook.SaveAs Filename:=(File1dest)
ActiveWorkbook.Close
Else
If Cells(14, 5).Value = "N" And Cells(14, 4).Value = "Y" Then
MsgBox "Report needs running before saving"
Else
If Cells(14, 5).Value = "N" And Cells(14, 4).Value = "N" Then
MsgBox "This file is in no way needed today move on to the next file buster!"
'Call line2000
End If
End If
End If
MsgBox "Update Complete"
'line 2000
End Sub
I just want to miss out the last message box as its pointless. Have tried as above Call line2000 and then put line2000 in at the bottom but it says I dont have a function defined.
Hope this makes sense.
Jess
Am trying to to get to the end of a macro by using the call function but its not working, does anyone have any ideas
Sub Save_File1()
Dim File1 As String
Dim File1dest As String
File1 = Worksheets("utilities").Cells(14, 13).Value
File1dest = Worksheets("utilities").Cells(14, 14).Value
Worksheets("utilities").Select
Worksheets("utilities").Activate
If Cells(14, 5).Value = "Y" Then
Workbooks.Open Filename:=(File1)
ActiveWorkbook.SaveAs Filename:=(File1dest)
ActiveWorkbook.Close
Else
If Cells(14, 5).Value = "N" And Cells(14, 4).Value = "Y" Then
MsgBox "Report needs running before saving"
Else
If Cells(14, 5).Value = "N" And Cells(14, 4).Value = "N" Then
MsgBox "This file is in no way needed today move on to the next file buster!"
'Call line2000
End If
End If
End If
MsgBox "Update Complete"
'line 2000
End Sub
I just want to miss out the last message box as its pointless. Have tried as above Call line2000 and then put line2000 in at the bottom but it says I dont have a function defined.
Hope this makes sense.
Jess