+ Reply to Thread
Results 1 to 7 of 7

print consecutive cells in a row

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    print consecutive cells in a row

    Hello,

    I have a worksheet in which I have to cycle through a selection of non-adjacent cells in multiple columns and rows,
    I first need to cycle the first row, then the second, and so on.
    (See attached file.)

    I would expect B2 C2 D2 F2 G2 H2 B3 C3 D3 F3 G3 H3 B4 C4 D4 F4 G4 H4

    but I get B2 C2 D2 B3 C3 D3 B4 C4 D4 B2 C2 D2 B3 C3 D3 B4 C4 D4

    How could I achieve the expected outcome?
    Attached Files Attached Files

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,964

    Re: print consecutive cells in a row

    How could I achieve the expected outcome?
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by Sintek; 05-27-2021 at 07:41 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: print consecutive cells in a row

    Quote Originally Posted by BartH_NL View Post
    I would expect B2 C2 D2 F2 G2 H2 B3 C3 D3 F3 G3 H3 B4 C4 D4 F4 G4 H4
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: print consecutive cells in a row

    Quote Originally Posted by sintek View Post
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thank you/baie dankie, sintek.

    So your solution is to change the reference of the cell ranges (Range("B2:D2,F2:H2,B3:D3,F3:H3,B4:D4,F4:H4"))

    In real life, these ranges would be selected manually by users and I don't presume I can get them to select the ranges row by row.
    They would select two (as in the example) or more blocks of cells.

    Nevertheless, your answer triggered me to write this procedure:

    Please Login or Register  to view this content.
    and that gives the desired result, so thanks for the inspiration!
    Then again, this will only work well if a regular selection is made and not something like (see attached image)
    Attached Images Attached Images
    Last edited by BartH_NL; 05-27-2021 at 08:49 AM. Reason: Found error

  5. #5
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: print consecutive cells in a row

    I found a solution that also works for irregular selections:

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by BartH_NL; 05-27-2021 at 03:07 PM. Reason: Found error

  6. #6
    Registered User
    Join Date
    07-20-2015
    Location
    Netherlands
    MS-Off Ver
    Win10, Off2019-365
    Posts
    44

    Re: print consecutive cells in a row

    Quote Originally Posted by jindon View Post
    Please Login or Register  to view this content.
    Hello Jindon,

    Thanks for your reply.

    I changed it to work with any selection but then find that not all cells are addressed:

    Please Login or Register  to view this content.
    Attached Images Attached Images

  7. #7
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,964

    Re: print consecutive cells in a row

    I found a solution that also works for irregular selections:
    Well done...Rep points for you...

+ 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] Asigning consecutive textbox values to multiple consecutive cells...
    By Hovoruha Octavian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2019, 06:31 PM
  2. How to print non-consecutive pages?
    By london7871 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-08-2017, 10:06 PM
  3. Print non-consecutive cells in same row on page
    By gumbyu in forum Excel General
    Replies: 0
    Last Post: 11-15-2016, 05:58 PM
  4. Replies: 1
    Last Post: 05-29-2013, 10:35 AM
  5. Print consecutive numbers
    By shootertec in forum Excel General
    Replies: 6
    Last Post: 10-12-2009, 05:48 PM
  6. Consecutive Numbering After Print
    By jamer02 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2009, 09:55 AM
  7. [SOLVED] How do I get my printer to print in consecutive order
    By printer f in forum Excel General
    Replies: 0
    Last Post: 06-15-2006, 11:30 AM

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