muhammad susanto
Well-known Member
- Joined
- Jan 8, 2013
- Messages
- 2,077
- Office Version
- 365
- 2021
- Platform
- Windows
hi all....
i'm looking for how this macro code/modify can print in specific number/record
e.q. print 2-5,8,100 etc..
here this code :
any help much appreciated...
m.susanto
i'm looking for how this macro code/modify can print in specific number/record
e.q. print 2-5,8,100 etc..
here this code :
Code:
Sub PrintRecord()Dim fromRecord, toRecord, answer, i As Integer
On Error Resume Next
fromRecord = InputBox("From record", "FROM", 1)
If fromRecord = 0 Or Not IsNumeric(fromRecord) Then Exit Sub
toRecord = InputBox("To record", "TO", fromRecord)
If toRecord < fromRecord Or Not IsNumeric(fromRecord) Then Exit Sub
answer = MsgBox("printing records" & fromRecord & " to " & toRecord, vbOKCancel, "PRINT")
If answer <> vbOK Then Exit Sub
For i = fromRecord To toRecord
[AM8] = i
With ActiveSheet
.PrintOut
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Next
End Sub
any help much appreciated...
m.susanto