+ Reply to Thread
Results 1 to 4 of 4

Double 'For Each Cell' loop range problem

  1. #1
    Registered User
    Join Date
    06-26-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    69

    Double 'For Each Cell' loop range problem

    Hi all,

    I’m doing a ‘for loop’ within a ‘for loop’ and the range does not change. I can’t figure out why.

    I need the variable ColumnB to give me the addresses of column B, but it returns $A$1 and so on.

    Thanks for an advice.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Canada Eh
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Double 'For Each Cell' loop range problem

    Hi gombi,

    Declaring variables will be very helpful as you learn how to code VBA. If you need to know about variable types, I suggest you Google VBA Variable types. As for the code itself, let me know if mine covers what you want. If yes, compare it to yours and think about the differences.
    Please Login or Register  to view this content.
    Click the * to give Rep to a post you like.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Double 'For Each Cell' loop range problem

    Try changinging Cell to Cell1 in the inner loop.

    Mind you I'm not sure you need 2 loops.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    06-26-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Double 'For Each Cell' loop range problem

    Try changinging Cell to Cell1 in the inner loop.
    Thanks a lot! That fixed my issue! :-)

+ 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. Vlookup problem in a loop with cell property and variable cell problem (long title sry)
    By ExcelsiorLux in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2013, 10:38 AM
  2. Problem using loop for sending excel range in email body using Range to HTML code
    By drajanm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-24-2012, 03:17 AM
  3. Loop and range problem
    By jalea148 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2012, 03:24 PM
  4. .Find problem when the found range's rows go from single to double digits
    By alsega in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-13-2012, 11:21 AM
  5. problem with Range statement in With-End With loop
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2010, 04:19 AM

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