Consulting

Results 1 to 6 of 6

Thread: How to populate data from one sheet to another?

  1. #1
    VBAX Regular
    Joined
    Nov 2015
    Posts
    43
    Location

    How to populate data from one sheet to another?

    I have 4 tabs in excel spreadsheet

    1. Output (13 Records)
    2. Show (search Button): VBA code attached and working fine.
    3. Requirement
    4. List of Values

    The idea is to display data from “Output” sheet based onsearch criteria (Zip Code) and display in “Show” sheet. I have written a VBAcode on “SEARCH” button and data is perfectly populated in “SHOW” sheet. No Issue.

    Currently data can only search by Zip code. I would like to search by territory, first name, last name, region and name ‘wild card” search etc. See the “requirement” dropdown values sheet.

    Any suggestion how to enhance the VBA code?
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Is it supposed to work as Zip OR Territory, or Zip AND Territory?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Apr 2016
    Posts
    3
    Location
    Hi pivotguy,
    I have tried two things:
    - On "show" sheet, you have a dropdown menu and the lookup uses a wild card, meaning if you are looking for "7" for a zip code, it will return 00077 and 71254 records
    - On "requirement" sheet, I added another dropdown list in C3 that is populated when the A3 list value changes: so you can't use wild cards but you have all possible entries that are proposed for any given section.

    In my opinion both solutions will work nicely if you don't have too many data. If you have a few thousands lines, it could be better to use autofilter to extract results.
    Attached Files Attached Files

  4. #4
    VBAX Regular
    Joined
    Nov 2015
    Posts
    43
    Location
    Louwelyn: Your code worked except a small glitch.

    Show Tab:

    First Name: M

    It should return all first name where letter “M” exist. Itreturned all values of first name “MELISSA”. But it also return “FIRST NAME”under First Name (Column C) because the letter “M” exist under label “FirstName”. The record should return only data, not column header.

  5. #5
    VBAX Newbie
    Joined
    Apr 2016
    Posts
    3
    Location
    Ooops, my bad, I forgot to check that.
    In every For i = 2 To finalrow and For j = 2 To finalrow replace 2 by 3, it will begin to search from the 3rd row instead of the 2nd.

  6. #6
    VBAX Regular
    Joined
    Nov 2015
    Posts
    43
    Location
    Louweyn Yes, the code is working .Thank for your time and effort. The issue is resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •