+ Reply to Thread
Results 1 to 4 of 4

Dynamic Columns and Rows Selecting all Loop

  1. #1
    Registered User
    Join Date
    02-15-2012
    Location
    Indianapolis, USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Dynamic Columns and Rows Selecting all Loop

    Hi,

    I'm using a spreadsheet that is updated often, new rows and columns are added almost daily. I'm trying to use a loop to start as a column select all the data in the column apply the conditional formatting then move to the next column.

    I know how to use a macro and apply the conditional formatting however, I'm struggling with trying to move along each column. Here is what I have so far:

    Please Login or Register  to view this content.
    I continue to get an error message saying I'm out of range when the program gets to "Range(StartCel,LastCel).Select".


    In summary I want to just have a loop that goes through the spreadsheet and selects all the data in Column F then in column G,H etc.

    I did not include my code about conditional formatting.

    please help!

    Thank you in advance for taking the time to help me!
    Last edited by excel0831; 02-22-2012 at 05:41 PM. Reason: Solved problem!

  2. #2
    Registered User
    Join Date
    02-15-2012
    Location
    Indianapolis, USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Dynamic Columns and Rows Selecting all Loop

    Thanks! This is my second time posting code to this forum. Therefore, I was unaware of how to post code.

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Dynamic Columns and Rows Selecting all Loop

    Change these lines -
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Without the .Address, it was considering the values in cells(2,j) and cells(lngrows, j).
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    02-15-2012
    Location
    Indianapolis, USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Dynamic Columns and Rows Selecting all Loop

    Thank you so much arlu1201!!!!! That worked!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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