+ Reply to Thread
Results 1 to 7 of 7

How to process cells not contiguos with For Each Next

  1. #1
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    How to process cells not contiguos with For Each Next

    Hello VBA friends,
    I'm learning VBA, i learnt how to use a for Each loop to process a range of cells , but now I'm stuck because i have different cells separeted (not contiguos)
    this is a simple code that I wrote
    Please Login or Register  to view this content.
    I need to print only what in cells "B3", "C5", "B9", "D10" but something goes wrong
    Thank you so much
    Attached Files Attached Files
    Last edited by XLalbania; 05-17-2021 at 05:42 AM.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: How to process cells not contiguos with For Each Next

    Please Login or Register  to view this content.
    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 star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Re: How to process cells not contiguos with For Each Next

    Hello Sintek, thank you for the answear, sorry But i didn't post the right workbook, now I edit and the range of cells now are mix
    B3, C5, B9, D10 all mixed

    i was thinking to write an array like this
    Set field = Range(Array("B3", "C5", "B9", "D10"))
    thank you
    Last edited by XLalbania; 05-17-2021 at 05:25 AM.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: How to process cells not contiguos with For Each Next

    Change
    Please Login or Register  to view this content.
    to red snippet
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Albania
    MS-Off Ver
    2013
    Posts
    215

    Re: How to process cells not contiguos with For Each Next

    Thank you very much
    Solved

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: How to process cells not contiguos with For Each Next

    Pleasure...thanks for rep +

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: How to process cells not contiguos with For Each Next

    Just FYI, for specific cells like that you can use:

    Please Login or Register  to view this content.
    Rory

+ 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. PROCESS TRACKING-Process status should be Displayed base from the next blank Cell
    By RAMILJAYLDOMA in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-16-2019, 09:17 AM
  2. [SOLVED] how can I take the value of several selected cells and process them in a loop ?
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2014, 03:00 AM
  3. dsum non contiguos criteria
    By aurisab in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-29-2013, 03:25 PM
  4. vba - copy non contiguos cells to a range in line
    By Osvaldo Palmeiro in forum Excel General
    Replies: 2
    Last Post: 12-20-2011, 07:44 PM
  5. Copy data from one set of cells to another cells and repeat the process -sheet attach
    By talhawahab in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-26-2011, 03:50 PM
  6. [SOLVED] How to count process running time ( process not finished)
    By miao jie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2005, 06:06 AM
  7. [SOLVED] How to count process running time ( process not finished)
    By miao jie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2005, 02:06 AM

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