+ Reply to Thread
Results 1 to 2 of 2

Loop across Columns and down Rows

  1. #1
    Registered User
    Join Date
    05-28-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    45

    Loop across Columns and down Rows

    Hi all,

    I am trying to put together a macro that loops across cells along columns, once it gets to an empty/blank cell it loops down rows. If all the cells in that column and range of rows are empty/blank - the macro hides the column, then continues on until the range of columns has reached the end.

    The range of columns will always be from 2 (B) to 23 (w)
    The range of rows will always start from 11 and be a variable length (never more than 200).


    So far i have the below code:

    This code runs along columns fine and checks to see if the cell is blank on row 11. However i've not managed to code the second part of the loop where it then goes down that column to check if the subsequent cells in the rows beneath are blank.

    The macro currently runs along the columns and then goes down to the next row (which i do not need).

    Please Login or Register  to view this content.

    I realise this may be rather confusing, however any help would be appreciated.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Loop across Columns and down Rows

    How about this:

    Please Login or Register  to view this content.

+ 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. Converting Columns to Rows using a Loop
    By DHazen in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-04-2013, 09:13 AM
  2. [SOLVED] For Next Loop across rows AND columns
    By GRazor71 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-31-2013, 02:05 PM
  3. Dynamic Columns and Rows Selecting all Loop
    By excel0831 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2012, 05:41 PM
  4. Loop rows and columns
    By twomind in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-09-2011, 11:40 AM
  5. loop through pivottables columns and rows
    By hpham77 in forum Excel General
    Replies: 1
    Last Post: 06-09-2006, 08:35 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