+ Reply to Thread
Results 1 to 5 of 5

Auto-fill next cell Question

Hybrid View

  1. #1
    Registered User
    Join Date
    08-14-2015
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Auto-fill next cell Question

    This is probably going to require at least a macro, if not VBA.
    In Sheet 1, I have a list of items in column A (delivery route) with a co-responding value in column B (distance). The value is static.
    What I want to do on Sheet 2 is when I enter the name of the route, it auto-populates the distance in the next column (or a designated cell or cells). So if on Sheet 1 I have a route called "Airport" and that route is 13 miles, if I type "airport", the next column over will automatically show 13.
    As an added bonus, I wonder if I can enter a short name (i.e. "air" instead of "airport") and have the cell either automatically change to airport (auto-correct, maybe?), or have airport pop up the next column over and then 13 automatically pop up one more column over.
    I'm not very good at macros; I can use the recorder and do a little fine tuning in the code, but VBA, I'm completely lost, but I hope someone can give me an idea.

    Much obliged.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,417

    Re: Auto-fill next cell Question

    Assuming you have typed Airport in A1 of Sheet2, then you can have this formula in B1:

    =IFERROR(VLOOKUP(A1&"*",Sheet!A:B,2,0),"")

    The asterisk will allow you to enter abbreviations, e.g. "air" instead of airport, but it might give unpredictable results. For example, if you have another entry on Sheet1 which starts with air (like Air Products Factory), then the formula will only return the distance for the first matching entry it finds, so you need to ensure that the number of letters entered in A1 will uniquely define the item that you want (i.e. "airp" for airport, and "Air P" for the factory - case does not matter).

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Auto-fill next cell Question

    Try this too see if it does what you want.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    08-14-2015
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Auto-fill next cell Question

    Thanks, John, for the starting point. How did you do that? Like I said, my VBA experience is virtually nil, and macro so-so, but once I see how it works, I pick it up fairly quickly.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Auto-fill next cell Question

    Right click on your sheet tab. Select view code. There is where the macro is included.

+ 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: 1
    Last Post: 09-07-2011, 05:57 PM
  2. Custom Auto-Fill Question Similiar To Google
    By Peeekay in forum Excel General
    Replies: 7
    Last Post: 11-11-2010, 02:42 PM
  3. VLookup / Auto-Fill Question
    By mikey968 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-25-2007, 09:34 PM
  4. Auto fill macro question
    By punter in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-16-2007, 10:53 AM
  5. auto fill question...
    By lovingggood in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-13-2007, 02:27 PM
  6. Is this possible - auto fill question
    By ScottyNM in forum Excel General
    Replies: 12
    Last Post: 12-22-2006, 12:01 PM
  7. Custom auto fill question
    By method373 in forum Excel General
    Replies: 2
    Last Post: 12-24-2005, 12:34 PM
  8. Auto Fill question
    By Backdoor Cover in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-19-2005, 02:21 PM

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