+ Reply to Thread
Results 1 to 1 of 1

Function for looping through multiple columns to match selections from comboboxes?

Hybrid View

hugo.hardy Function for looping through... 08-09-2012, 04:53 AM
  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Ascot
    MS-Off Ver
    Excel 2010
    Posts
    1

    Function for looping through multiple columns to match selections from comboboxes?

    I am a new VBA user and have run into a problem. I have 3 comboboxes on a worksheet and a list which has 4 columns on another. The first three columns have many duplicate values. I need a function, which when three selections are made will loop through the rows and when a match is found in all three columns the value in the fourth column is copied on to the first worksheet. I know how I can do this for each row individually with IF and Then, but this would very large as there are hundreds of rows. Is there a way to loop through each column and for the rows that match to loop through the next column etc. Any hints on how I could achieve this would be greatly appreciated.

    This it what I am trying to achieve for one row, but I need it to loop through all rows:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Range("D16") = Sheets("Rates List").Range("B5") And Range("D22") = Sheets("Rates List").Range("C5") And Range("E22") = Sheets("Rates List").Range("D5") Then
    
    Range("M22").Value = Sheets("Rates List").Range("F5")
    
    End If
    
    End Sub
    Last edited by hugo.hardy; 08-09-2012 at 05:53 AM.

+ Reply to Thread

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