+ Reply to Thread
Results 1 to 4 of 4

How to automatically fill a cell based on another cell's content

  1. #1
    Registered User
    Join Date
    04-07-2019
    Location
    Mexico
    MS-Off Ver
    2016
    Posts
    6

    How to automatically fill a cell based on another cell's content

    Hi I want my code to do something like this:

    If I type "Houston", "Dallas" or "Austin" in any row from colum A the same row in column B could be filled with "Texas"

    Please Login or Register  to view this content.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: How to automatically fill a cell based on another cell's content

    Hi and welcome.

    Are these the only place names you're interested in for this or are there many more?

    The answer will dictate the best way to do this.

    BSB

  3. #3
    Registered User
    Join Date
    04-07-2019
    Location
    Mexico
    MS-Off Ver
    2016
    Posts
    6

    Re: How to automatically fill a cell based on another cell's content

    I will include seven States . Each one with 10 or more cities. Thanks!

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: How to automatically fill a cell based on another cell's content

    Personally I would do this with a lookup formula such as VLOOKUP or INDEX/MATCH and have the list of cities and states stored in the workbook on a hidden sheet.
    This would make changes to that list quicker and easier to make.

    But if you want a VBA approach then the below in the worksheet module is one way:
    Please Login or Register  to view this content.
    Obviously you'll need to amend the cities and state names in this example and add more to cover all you're interested in for this but should be straightforward to follow.

    BSB

+ 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. Replies: 4
    Last Post: 03-26-2015, 12:45 PM
  2. Automatically copy cells content based on the content of another cell.
    By chrisbarlow1984 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2014, 11:13 AM
  3. Replies: 1
    Last Post: 07-02-2013, 08:58 PM
  4. [SOLVED] VBA referring to a different sheet, automatically fill cell based on content of other cell
    By mweick in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 02-06-2013, 11:50 AM
  5. Formula, fill in descriptions based on cell content
    By sinnes in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-25-2010, 04:41 PM
  6. Replies: 4
    Last Post: 01-26-2010, 02:28 PM
  7. Fill Cell Based on Row Content
    By SailorGuy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-08-2007, 10:02 PM

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