+ Reply to Thread
Results 1 to 4 of 4

Moving to next column in code

  1. #1
    Registered User
    Join Date
    02-12-2007
    Posts
    88

    Question Moving to next column in code

    Is there a way I can create a loop so that the value of a range of cells can be checked?

    For example I need to loop from cell A1 to cell B1 to cell C1 to cell D1 etc

    Can I use a do until loop for this?

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    You can use For loops, Do loops, While Loops

    If you gave more detail of what you are trying to acheive then you will get a better answer

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-12-2007
    Posts
    88
    OK...

    I'm trying to check a range of cells until I find one that contains the text "Start", this range of cells is on a row. So my logic towards the scenario is to use a loop going through each cell checking the value until it finds start and then recording the cells reference (A1) in another cell.

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    If you are trying to locate a word it is far quicker to use the find command

    The following example finds the word Start on your activesheet & displays the location in a message box

    Please Login or Register  to view this content.
    If you know the row it is in then replace
    cells.find
    with
    Rows(Place row number here).Find

    If you know the column it is in then use
    columns(Place column number here).Find

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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