Results 1 to 6 of 6

Ubound and Lbound

Threaded View

  1. #1
    Registered User
    Join Date
    09-10-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Ubound and Lbound

    Hi guys,

    I was trying to do write a code that reads the 10th column of the row of the activecell and return the country i set in my array "arrcountry". It returns the first value and would not loop through the remaining. Am i doing something wrong here? Thanks.

    Dim i As Integer

    arrCountry(0, 0) = "USD"
    arrCountry(0, 1) = "United State"

    arrCountry(1, 0) = "SEK"
    arrCountry(1, 1) = "Sweden"

    For i = LBound(arrCountry, 1) To UBound(arrCountry, 1)
    Set Country = Cells(ActiveCell.row, 10)
    If Country = arrCountry(i, 0) Then
    ActiveCell = arrCountry(i, 1)
    ActiveCell.Offset(1, 0).Select
    End If

    Next
    Last edited by hommer; 09-21-2010 at 11:44 AM.

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