+ Reply to Thread
Results 1 to 11 of 11

Auto increment

  1. #1
    Registered User
    Join Date
    05-07-2018
    Location
    Arba Minch
    MS-Off Ver
    2003-2010
    Posts
    8

    Auto increment

    Lets say i have 80 rows and i want to print 20 rows in one page so i have four pages. Here i want to increment a cell value or the header of the excel every time i print the pages. For example if i print for the first time the print counter cell will be 1 in the first page 2 in the second page 3 in the third page and 4 on the forth page. Again if i print one copy i need to see 5 on the first page 6 in the second page 7 in the third page and 8 on the forth page... so i need a Macro code for this if possible. I will be happy to get any assistance on it. Thanks

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Auto increment

    1 way to handle, the counter in sheet counter, just change the red part to the ranges needed
    Please Login or Register  to view this content.
    Kind regards
    Leo
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-07-2018
    Location
    Arba Minch
    MS-Off Ver
    2003-2010
    Posts
    8

    Re: Auto increment

    Dear LeoTaxi,

    Thanks for the reply but the code couldn't give me what i want.
    What i want is like for example

    I have 80 rows to be printed in four pages and then i print for the first time the first printed page should have a page numbered 1 the second page will be 2 the third page will be 3 and the fourth page will be 4. If again print it then the first page should be 5(continuation from the last page of the previous print out. The second page will be 6 the third will be seven the fourth will be 8. If again i print four the third time 9, 10, 11 and 12. That is what i want.

    Thanks,

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Auto increment

    So only thing to do is changes the ranges to

    Please Login or Register  to view this content.
    Kind regards
    Leo

  5. #5
    Registered User
    Join Date
    05-07-2018
    Location
    Arba Minch
    MS-Off Ver
    2003-2010
    Posts
    8

    Re: Auto increment

    Every thing is in one sheet names sheet1 i don't have any other sheet. when i run this code you wrote it shows the sheet error.

  6. #6
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Auto increment

    If data is only in 1 sheet, first code works, only you have to add new sheet and name it Counter
    and adjust the 4 ranges marked in red.

    Kind regards
    Leo

  7. #7
    Registered User
    Join Date
    05-07-2018
    Location
    Arba Minch
    MS-Off Ver
    2003-2010
    Posts
    8

    Re: Auto increment

    Dear LeoTaxi,

    Thanks, now it is working fine but when i print for the second time it starts counting from four, but it should begin from 5(continuation from the last page which is 4). Is there a way to fix this?

    Thanks,

  8. #8
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Auto increment

    yes, forgot to mention, cell A1 from sheets counter should have value 1 before use

    Kind regards
    Leo

  9. #9
    Registered User
    Join Date
    05-07-2018
    Location
    Arba Minch
    MS-Off Ver
    2003-2010
    Posts
    8

    Re: Auto increment

    I understood the code and it is working good but i don't understand why it is getting in to problem when it comes to the second print it repeats page four as i told you before after adjusting the a1=1 in the Counter sheet as you told me.

  10. #10
    Registered User
    Join Date
    05-07-2018
    Location
    Arba Minch
    MS-Off Ver
    2003-2010
    Posts
    8

    Re: Auto increment

    Dear LeoTaxi,

    Thanks for your support now it is working as expected.

    Thanks,

  11. #11
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Auto increment

    Glad i could help and tanksfor the rep.

    Kind regards
    Leo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Increment Scroll bar By 1 Auto VBA
    By keen2xl in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-16-2020, 12:49 AM
  2. [SOLVED] Function auto increment
    By simontfs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2019, 04:40 PM
  3. [SOLVED] Auto Increment ID
    By marcusduton in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-07-2015, 08:27 PM
  4. Auto Increment Formula
    By bgates in forum Excel General
    Replies: 5
    Last Post: 12-31-2014, 10:32 AM
  5. Auto increment column A
    By nikko50 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2014, 12:19 PM
  6. Auto increment ID
    By Jakes in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2012, 06:32 AM
  7. [SOLVED] DP Auto increment
    By [email protected] in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-15-2006, 07:40 PM

Tags for this Thread

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