View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
BrianB BrianB is offline
external usenet poster
 
Posts: 1
Default Printing Consecutive Numbers

This is one I "prepared earlier". There are 2 bills per sheet and 29
bills altogether. The number cell of the 2nd. bill on the worksheet
(range name "Number") refers to the number of the top bill and adds 1
with the formula :-
=IF(Number<=28,Number+1,1)
'---------------------------------------------------------
Sub PRINT_ALL_eBILLS()
'--------------------------
rsp = MsgBox("About to print all Electicity bills." & vbCr _
& "OK to proceed ?", vbYesNo, "PRINT BILLS")
If rsp <vbYesThen End
'---------------------------
Dim MyBill As Worksheet
Set MyBill = ThisWorkbook.Worksheets("Electricity Bills")
Application.Goto reference:=MyBill.Range("A1")
'-
For b = 1 To 29 Step 2
MyBill.Range("Number").Value = b
'MyBill.PrintPreview ' for test purposes & commented out
MyBill.PrintOut Copies:=1
Next
End Sub
'--------------------------------------------------------



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/