+ Reply to Thread
Results 1 to 7 of 7

Automatically incrementing number for each print

  1. #1
    Nefermet
    Guest

    Automatically incrementing number for each print

    I'm trying to create a jobsheet that will automatically increment the
    jobsheet number each time it is printed. Is this possible?

  2. #2
    Duke Carey
    Guest

    RE: Automatically incrementing number for each print

    Only through VBA code. If you're willing to go that route, post back with
    details and one of us will offer more detailed advice

    "Nefermet" wrote:

    > I'm trying to create a jobsheet that will automatically increment the
    > jobsheet number each time it is printed. Is this possible?


  3. #3
    Bernie Deitrick
    Guest

    Re: Automatically incrementing number for each print

    You could use the before print event to increment a value:

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Worksheets("Sheet1").Range("A1").Value = Worksheets("Sheet1").Range("A1").Value + 1
    End Sub

    Note that this will only work if you print only one sheet at a time - printing multiple copies only
    fires this event once.

    Otherwise, you could use a macro to print multiple copies:

    Sub PrintEm()
    Dim i As Integer
    For i = 1 to 100
    Worksheets("Sheet1").Range("A1").Value = Worksheets("Sheet1").Range("A1").Value + 1
    Worksheets("Sheet1").PrintOut
    Next i
    End Sub

    HTH,
    Bernie
    MS Excel MVP


    "Nefermet" <Nefermet@discussions.microsoft.com> wrote in message
    news:9E03EB41-1617-441B-A1DF-575E151B104B@microsoft.com...
    > I'm trying to create a jobsheet that will automatically increment the
    > jobsheet number each time it is printed. Is this possible?




  4. #4
    Nefermet
    Guest

    RE: Automatically incrementing number for each print

    Hi Duke and Bernie,

    I've had a look at the solution provided by Bernie, the second macro looks
    most promising except that it will fire out the set qty I want straight away
    without giving me the option to put two on one sheet (they're only A5 size).
    Or can I set this in the printing options?

    Thanks for your help, its exactly what I'm after so far!

    Nefermet

    "Duke Carey" wrote:

    > Only through VBA code. If you're willing to go that route, post back with
    > details and one of us will offer more detailed advice
    >
    > "Nefermet" wrote:
    >
    > > I'm trying to create a jobsheet that will automatically increment the
    > > jobsheet number each time it is printed. Is this possible?


  5. #5
    Bernie Deitrick
    Guest

    Re: Automatically incrementing number for each print

    Duke,

    Try copying your print range and pasting below your current print range, then change your print are
    to include both. Then you could use two lines of code instead of one, along the line of:

    Sub PrintEm()
    Dim i As Integer
    For i = 1 to 50

    Worksheets("Sheet1").Range("A1").Value = Worksheets("Sheet1").Range("A1").Value + 2
    Worksheets("Sheet1").Range("A15").Value = Worksheets("Sheet1").Range("A15").Value + 2
    Worksheets("Sheet1").PrintOut
    Next i
    End Sub

    HTH,
    Bernie
    MS Excel MVP


    "Nefermet" <Nefermet@discussions.microsoft.com> wrote in message
    news:54CFB26C-A699-4160-AAA2-20E13956672B@microsoft.com...
    > Hi Duke and Bernie,
    >
    > I've had a look at the solution provided by Bernie, the second macro looks
    > most promising except that it will fire out the set qty I want straight away
    > without giving me the option to put two on one sheet (they're only A5 size).
    > Or can I set this in the printing options?
    >
    > Thanks for your help, its exactly what I'm after so far!
    >
    > Nefermet
    >
    > "Duke Carey" wrote:
    >
    >> Only through VBA code. If you're willing to go that route, post back with
    >> details and one of us will offer more detailed advice
    >>
    >> "Nefermet" wrote:
    >>
    >> > I'm trying to create a jobsheet that will automatically increment the
    >> > jobsheet number each time it is printed. Is this possible?




  6. #6
    Nefermet
    Guest

    Re: Automatically incrementing number for each print

    Brilliant! with a little bit of tweeking that works perfectly!

    Thanks for your help.

    Nefermet

    "Bernie Deitrick" wrote:

    > Duke,
    >
    > Try copying your print range and pasting below your current print range, then change your print are
    > to include both. Then you could use two lines of code instead of one, along the line of:
    >
    > Sub PrintEm()
    > Dim i As Integer
    > For i = 1 to 50
    >
    > Worksheets("Sheet1").Range("A1").Value = Worksheets("Sheet1").Range("A1").Value + 2
    > Worksheets("Sheet1").Range("A15").Value = Worksheets("Sheet1").Range("A15").Value + 2
    > Worksheets("Sheet1").PrintOut
    > Next i
    > End Sub
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    > "Nefermet" <Nefermet@discussions.microsoft.com> wrote in message
    > news:54CFB26C-A699-4160-AAA2-20E13956672B@microsoft.com...
    > > Hi Duke and Bernie,
    > >
    > > I've had a look at the solution provided by Bernie, the second macro looks
    > > most promising except that it will fire out the set qty I want straight away
    > > without giving me the option to put two on one sheet (they're only A5 size).
    > > Or can I set this in the printing options?
    > >
    > > Thanks for your help, its exactly what I'm after so far!
    > >
    > > Nefermet
    > >
    > > "Duke Carey" wrote:
    > >
    > >> Only through VBA code. If you're willing to go that route, post back with
    > >> details and one of us will offer more detailed advice
    > >>
    > >> "Nefermet" wrote:
    > >>
    > >> > I'm trying to create a jobsheet that will automatically increment the
    > >> > jobsheet number each time it is printed. Is this possible?

    >
    >
    >


  7. #7
    Bernie Deitrick
    Guest

    Re: Automatically incrementing number for each print

    Nefermet,

    Glad to hear it worked! And sorry about addressing you as "Duke" last reply....

    Bernie
    MS Excel MVP

    > Brilliant! with a little bit of tweeking that works perfectly!
    >
    > Thanks for your help.




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1