+ Reply to Thread
Results 1 to 12 of 12

Make selection and fill information

  1. #1
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    25

    Make selection and fill information

    I want to select any and only one fruit from an excel file, and once that selection is made, the fruit name along with its information gets assigned to a code next in line in a different excel file and those cells fill themselves with that information. Once that is done, the code # gets printed in the original excel file beside the fruit that was selected.

    Images are below:

    Capture1.PNG
    Capture2.PNG

    The VBA code to make the selection is already been written, so don't worry about that. FYI that code is:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Make selection and fill information

    Something like this - change the filename and sheet name: the other file must be open for this to work

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    25

    Re: Make selection and fill information

    Quote Originally Posted by Bernie Deitrick View Post
    Something like this - change the filename and sheet name: the other file must be open for this to work

    Please Login or Register  to view this content.
    I appreciate you doing the code. It works perfectly. However, it didn't help me as I expected. The content I have is not as organized in the file, so I am assuming the code needs to be changed a little. Please see the images below:

    Capture3.PNG
    Capture4.PNG

    Top image: The user needs to select one of the three files (File1, File2, or File3). The user selected file opens automatically
    Bottom image: Then whatever next row is blank in that file, the user entered information length, width, and height from the first file fills out, and gives back the code# in the first file.
    Attached Images Attached Images

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Make selection and fill information

    So you want the number 2 returned - but to where? A specific cell, or list starting in a cell and extending down a column?

    Are File1 File2 and File3 actual file names? Where are the files stored? What are their full names?

  5. #5
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    25

    Re: Make selection and fill information

    Quote Originally Posted by Bernie Deitrick View Post
    So you want the number 2 returned - but to where? A specific cell, or list starting in a cell and extending down a column?

    Are File1 File2 and File3 actual file names? Where are the files stored? What are their full names?
    File1.xls
    File2.xls
    File3.xls

    The files are actually in one of the folders in my C: drive.

    For example: Let's say I select the yellow highlighted cell beside File2, so there is a check mark in there, and as a result File2 opens. Now, the length, width, and height of 12,20,5 (these cells should be initially blank), respectively will be automatically copied beside code 3 line because that's the next empty row. After that, the code # 3 will be copied in the original file beside the bold word "Code".

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Make selection and fill information

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 07-18-2017 at 11:10 AM.

  7. #7
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    25

    Re: Make selection and fill information

    Quote Originally Posted by Bernie Deitrick View Post
    Please Login or Register  to view this content.
    That one works perfect. Awesome!
    What if I want to select specific sheet in the file. For ex: In the image below if I select File1, then I must also select which sheet I want such as Sheet1 or Sheet2.

    Capture5.PNG

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Make selection and fill information

    Try it like this, without columns G and H:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    25

    Re: Make selection and fill information

    What if I have File2 and File3 in a different location such as the X: drive?

  10. #10
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    25

    Re: Make selection and fill information

    Quote Originally Posted by Bernie Deitrick View Post
    Try it like this, without columns G and H:

    Please Login or Register  to view this content.
    I just realized that I actually didn't need to worry about the sheets, but rather having the files in different locations. I apologize. What if I have File2 and File3 in a different location such as the X: drive?

  11. #11
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Make selection and fill information

    Put the drive into another cell - say, to the right of the cells that you are clicking on, and change


    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Enter the full path (but without the final \ ) into those cells.

  12. #12
    Registered User
    Join Date
    06-28-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    25

    Re: Make selection and fill information

    Quote Originally Posted by Bernie Deitrick View Post
    Put the drive into another cell - say, to the right of the cells that you are clicking on, and change


    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Enter the full path (but without the final \ ) into those cells.
    Perfect! Thank you so much. I really appreciate all your help. I think I am going to try to learn Excel VBA.

+ 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] Make an automatic fill on different sheet which sorted fill
    By stermy in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-11-2016, 09:23 AM
  2. Dropdown box - Information to disappear from selection
    By webstp01 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-15-2014, 06:47 AM
  3. Using VBA to pre-fill website information
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2014, 04:46 PM
  4. Replies: 1
    Last Post: 01-23-2014, 09:31 AM
  5. Information from a drop down list selection
    By Evander in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-24-2013, 03:43 PM
  6. Fill information from another worksheet
    By tt9600 in forum Excel General
    Replies: 0
    Last Post: 09-21-2011, 11:53 AM
  7. Replies: 1
    Last Post: 02-27-2011, 08:55 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