+ Reply to Thread
Results 1 to 4 of 4

Loop Across Columns If Blank Cell Loop Down Rows

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

    Loop Across Columns If Blank Cell Loop Down Rows

    The below code loops across columns in a predefined range, when it hits a blank cell it marks that cell 'test'

    What i actually need the code to do is once it hits a blank cell, it loops down the rows in that column....if all the cells in the column for the range of rows are blank, i need the macro to hide that column. Once a column has been hidden i need the code to carry on through the columns in the pre defined range.

    Is anyone able to help me complete the code below ? I am fairly lost with this now and help would be appreciated.


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Loop Across Columns If Blank Cell Loop Down Rows

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

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

    Re: Loop Across Columns If Blank Cell Loop Down Rows

    The hide columns part does not seem to work, i think it may be something to do with the End(xlUp) section of the code, is there a different way of validating this check??

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Loop Across Columns If Blank Cell Loop Down Rows

    Quote Originally Posted by flindy87 View Post
    The hide columns part does not seem to work, i think it may be something to do with the End(xlUp) section of the code, is there a different way of validating this check??

    Do you have formulas that return "" in the empty columns? If yes, try this...

    Columns(i).Hidden = Columns(i).Find("*", , xlValues, , 1, 2).Row = beg_row
    Last edited by AlphaFrog; 02-05-2014 at 10:26 AM.

+ 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] Trying to write a Loop to perform calculations within blank rows between populated rows
    By ObliviousAmI in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-15-2014, 06:35 PM
  2. [SOLVED] Loop to delete rows on another tab and run until blank cell is met.
    By SillySox in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-14-2013, 11:09 PM
  3. loop through rows for match insert blank rows with title
    By reeyu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 07:34 AM
  4. Hide blank columns via loop
    By SunOffice in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2011, 10:17 PM
  5. Deleting blank rows using loop and SpecialCells
    By SOS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2008, 09:40 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