Here is the updated macro
Insert a sheet named Sheet1 (or you can name it whatever and change Sheet1
below to that name). You can try to hide that sheet too.
in Col A enter the sheet names you want the users to be able to print
in Col B enter the total pagenumbers for the sheet in corresponding cell in
Col A
Max 20 sheets
Sub printPages()
Dim i, j As Integer
Dim shName(20), nPages(20) As String
Dim response, response2 As Variant
msg = "Please select the sheet to print" & vbCrLf & vbCrLf
j = Sheets.Count - 1
For i = 1 To j
shName(i) = Sheets("Sheet1").Cells(i, 1).Value
nPages(i) = Sheets("Sheet1").Cells(i, 2).Value
msg = msg & i & " to print : " & shName(i) & vbCrLf
'MsgBox shname & " has " & nPages & " pages."
Next
response = InputBox(msg)
If response = "" Then
Exit Sub
Else
response = CInt(response)
End If
If response < (j + 1) Then
msg = "Please type the number of pages to print from: " & _
shName(response) & vbCrLf & vbCrLf
msg = msg & "Enter 0 to print all pages" & vbCrLf
For i = 1 To nPages(response)
msg = msg & "Enter " & i & " to print page number: " & i & vbCrLf
Next
response2 = InputBox(msg)
If response2 = "" Then
Exit Sub
Else
response2 = CInt(response2)
End If
Else
MsgBox "Wrong choice. Pl. choose again."
Exit Sub
End If
If response2 > nPages(response) Then
MsgBox "Wrong choice. Pl. choose again."
Exit Sub
End If
If response2 = 0 Then
ActiveSheet.PrintOut 1, nPages(response)
Else
ActiveSheet.PrintOut response2, response2
End If
End Sub