+ Reply to Thread
Results 1 to 7 of 7

how to loop though a cell range in VBA

  1. #1
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Smile how to loop though a cell range in VBA

    Hi

    Des anyone know how loop though a cell range ("F4-U644") and say If the cell is empty move to the next one else add the value "1" to the cell?

    Thanks

    Jeskit
    Last edited by jeskit; 04-20-2011 at 11:09 AM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: how to loop though a cell range in VBA

    By add 1 to the data in the cell, do you mean:
    put a 1 at the end of the data: abc===>abc1
    or replace the data with 1? abc===>1
    or add 1 mathematically? 12345====>12346?

  3. #3
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: how to loop though a cell range in VBA

    hI

    Sorry i shold ahve been more specific.

    I meant i want to replace whatever data that is in the cell the "1"

    thanks for replying

  4. #4
    Registered User
    Join Date
    03-16-2004
    Location
    UK
    MS-Off Ver
    2003
    Posts
    85

    Re: how to loop though a cell range in VBA

    Is this what you are looking for?

    Please Login or Register  to view this content.
    Phil

  5. #5
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: how to loop though a cell range in VBA

    Hi

    Yeah thanks for your help!

    However is mycell supposed to be a variable?

    Thanks for your help

  6. #6
    Registered User
    Join Date
    03-16-2004
    Location
    UK
    MS-Off Ver
    2003
    Posts
    85

    Re: how to loop though a cell range in VBA

    Yes, mycell is a variable. You can use another variable name if you like.

  7. #7
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: how to loop though a cell range in VBA

    Thanks for your help I greatly appricate it thanks

+ 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