Start2 already exist and not continuing

Abdulai_1

New Member
Joined
Dec 20, 2021
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
VBA Code:
Sub Prints()
'
Dim i As Long
Dim q As Integer

q = Range("WrongName").Value

If q = 0 Then

Sheet6.Visible = xlSheetVisible

For i = 1 To Range("PupilCount")
    Sheet6.Copy after:=Worksheets(Worksheets.Count)
    Range("D1").Value = i
    ActiveSheet.Name = Range("B2")
        If i = 1 Then
        x = Application.Dialogs(xlDialogPrinterSetup).Show
            If x = False Then
            MsgBox "All printing has been cancelled"
            Application.DisplayAlerts = False
            ActiveWindow.SelectedSheets.Delete
            Application.DisplayAlerts = True
            Sheet6.Visible = xlSheetHidden
            Exit Sub
        End If
    End If
    ActiveWindow.SelectedSheets.PrintOut
      
Next i
Sheet6.Visible = xlSheetHidden
End If

If q = 1 Then
MsgBox "You have 1 entry for which the names do not match." & vbCrLf & _
"Please find these by filtering the 'Match?' column to FALSE on the Student Reference tab and then making the necessary " & _
"changes in either the NCalc Data or Calc Data tab", vbExclamation

Sheet3.Select
Range("D1").Select
Exit Sub
End If

If q > 1 Then

MsgBox "You have " & q & " entries for which the names do not match." & vbCrLf & _
"Please find these by filtering the 'Match?' column to FALSE on the Student Reference tab and then making the necessary " & _
"changes in either the NCalc Data or Calc Data tab (or both).", vbExclamation

Sheet3.Select
Range("D1").Select
End If


End Sub
 
Last edited by a moderator:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
What is your question? Your thread title doesn't really explain your question. There is no other text in your post and the name "Start2" doesn't appear anywhere in your code.
 
Upvote 0
I am trying to generate exam reports and print them together instead of printing one at a time. I can't seem to upload the file so I have taken a print screen of the report page. There are 93 reports and I want run all of them and then print.

Thanks
 

Attachments

  • print.png
    print.png
    185.6 KB · Views: 8
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,438
Members
449,083
Latest member
Ava19

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