Results 1 to 7 of 7

Looping using left function resulting in Concatenate

Threaded View

jaimie1664 Looping using left function... 07-09-2010, 12:30 PM
Marcol Re: Looping using left... 07-09-2010, 12:46 PM
Marcol Re: Looping using left... 07-09-2010, 12:59 PM
jaimie1664 Re: Looping using left... 07-12-2010, 04:17 AM
Marcol Re: Looping using left... 07-12-2010, 04:43 AM
jaimie1664 Re: Looping using left... 07-12-2010, 06:22 AM
Marcol Re: Looping using left... 07-12-2010, 08:12 AM
  1. #1
    Registered User
    Join Date
    04-20-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    26

    Looping using left function resulting in Concatenate

    Hello Everyone - I am trying to produce a loop that loops through a vertical columm picking up the cells string that starts with "AGL" and puting an "&" on the end and untill it reaches a blank column. The best i have come up with is but not working, can anyone help?


    Sub FindNum()
    Dim strNumb As String
    Dim lastrow As String
    
    lastrow = ActiveSheet.UsedRange.Rows.Count
    For Each cell In ActiveSheet.Range("K6:K" & lastrow)
    
       If cell(Left(cell, 1) = "EGL") Then
        If strNumb = "" Then
            strNumb = cell.Offset(0, 1)
            Else
                strNumb = strNumb & "&" & cell.Offset(0, 1)
            End If
        End If
    Next
    
    
    End Sub
    can anyone help please


    thanks
    Jay
    Last edited by jaimie1664; 07-12-2010 at 03:58 AM.

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