Results 1 to 2 of 2

For Each loop; worksheets.range

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-15-2009
    Location
    Herndon, VA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Thumbs down For Each loop; worksheets.range

    This should be a very simple procedure. I can't tell what is wrong. In the end the words "It worked" should populate to the far right. Not sure if I am incorrectly using the "concat" object variable in the IF statement. I'm not receiving any error messages. The hour glass does show after I run the macro, so something is happening. Can anybody offer some insight?


    Sub populateSchI()
        
        Dim chargeNo As Range
        Dim concat As Range
        
        Set chargeNo = Worksheets("Schedule I").Range("A6")
        
        For Each concat In Worksheets("2008").Range("D:D")
            If concat.Value = chargeNo.Value Then
                concat.Offset(0, 7).Value = "It worked"
            End If
        Next concat
            
    
    End Sub
    Last edited by davesexcel; 12-15-2009 at 11:40 PM. Reason: Code tags are required when submitting VBA code, read the forum rules.

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