Results 1 to 4 of 4

Double 'For Each Cell' loop range problem

Threaded View

  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.

    Sub Rectangle1_Click()
    
       For Each Cell In Range("A1:A4")
         
        ColumnA = Cell.Address
        MsgBox ColumnA
                
                    For Each Cell1 In Range("B1:B4")
                        ColumnB = Cell.Address
                        MsgBox ColumnB
                    Next Cell1
        Next Cell
    End Sub
    Attached Files Attached Files

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