+ Reply to Thread
Results 1 to 3 of 3

Looping through rows of data to find a certain city

  1. #1
    Registered User
    Join Date
    12-09-2016
    Location
    Irvine, CA
    MS-Off Ver
    2013
    Posts
    32

    Looping through rows of data to find a certain city

    Hi,

    I am new to VBA code and have what I think is a relatively simple problem.

    I have cities in a drop down box in cell F3 and when a certain city is selected data will pull to show the population of that city. The population data is on the same worksheet with the city names listed in column M and the population in Column N. Is there a way to have macro look through the cities to match cell F3 and pull the population to cell G3?



    Thank you,

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Looping through rows of data to find a certain city

    Quicker and easier to use a VLOOKUP.

  3. #3
    Registered User
    Join Date
    12-09-2016
    Location
    Irvine, CA
    MS-Off Ver
    2013
    Posts
    32

    Re: Looping through rows of data to find a certain city

    Thank you, that is a good idea. I was concerned because I want to multiply the value I am pulling by a number, but I will pull the single value and then multiply by the quantity. (I am not really pulling population, that was just the simplest way to explain)


    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula to Find Unique Customers per City
    By mo4391 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-29-2016, 12:41 PM
  2. Looping through rows to consolidate mismatched data?
    By DouglasMacArthur in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2016, 02:31 PM
  3. Replies: 3
    Last Post: 04-09-2015, 08:00 PM
  4. Calculating Shipment Rates Base on Origin City and Destination City
    By Chnatko in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-09-2014, 11:11 AM
  5. Calculating City to City -road miles
    By williesmith2008 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-22-2012, 05:19 AM
  6. extract city using city list lookup
    By terrysoper1973 in forum Excel General
    Replies: 1
    Last Post: 09-07-2011, 01:43 PM
  7. [SOLVED] Looping macro needed to find intersections of rows and columns
    By Clifford Middleton in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2006, 09:10 AM

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