Closed Thread
Results 1 to 6 of 6

Ubound and Lbound

Hybrid View

  1. #1
    Forum Contributor daksh1981's Avatar
    Join Date
    04-15-2009
    Location
    India
    MS-Off Ver
    2003 & 2007
    Posts
    110

    Smile Re: Ubound and Lbound

    Hi hommer,
    Please find the attached file. Hope this will help you to solve your problem.
    Please find the below snapshot of the code I have used in this attached file.

    Sub test1()
    Dim i As Integer
    Dim arrCountry(10) As String
    Dim arrCurrency(10) As String
    
    j = 2
    arrCountry(0) = "United State"
    arrCountry(1) = "Sweden"
    arrCountry(2) = "Hong Kong"
    
    arrCurrency(0) = "USD"
    arrCurrency(1) = "SEK"
    arrCurrency(2) = "HKD"
    
    For i = LBound(arrCountry) To UBound(arrCountry)
    If arrCountry(i) = "" Then
    Exit Sub
    End If
    
    Country = arrCountry(i)
    If Country = ActiveSheet.Range("A" & j).Value Then
    ActiveSheet.Range("B" & j).Value = arrCurrency(i)
    
    End If
    j = j + 1
    Next
    
    End Sub
    Regards,
    Daksh
    Attached Files Attached Files
    Last edited by daksh1981; 09-21-2010 at 11:59 AM. Reason: Forgot to attaché file..
    I am still a learner.

Closed Thread

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