+ Reply to Thread
Results 1 to 8 of 8

Macro fill cell based on value from another sheet - columns change

  1. #1
    Registered User
    Join Date
    10-31-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    14

    Macro fill cell based on value from another sheet - columns change

    Hi all,

    I could use a bit of help here.

    I have a file with a master list of data, titled "Values." In this sheet, I have specific identifying columns - Building #, Floor # and Unit. (Columns B, C and D, respectively). This sheet contains information for all units on all floors in 5 different buildings.

    I then have separate sheets for each separate building, with all the same column headings.

    What I want to do is have the column for "sale price" sheets for the individual building autofill when a price is entered in to the "Values" sheet [column F is sale price].

    I know I could use a VLOOKUP, but I would like a macro for this, unless someone can give me a good solution. My problem is that I (and others) will be sorting the data in the sheets based on multiple factors. For example, I may want to sort by the units in a building (i.e. price for each "A" unit) or by floors (all units on 5th floor) or, on the master sheet, an advance search by first building, then floor, etc... I'm also concerned about someone using the sheet and deleting the vlookup formula in the columns!

    Is there a way to do this? Does my description make sense?

    See the attached file...

    Thanks for all the help!
    TY0296.XLS

    I am editing this down here because I am not sure I was clear.

    When I enter a sales price value into Sheet 1 "Values" (Column F), I want that figure to be automatically filled in on a separate sheet which corresponds to the building I am referencing. So, I am imagining the macro has to check 3 figures - building (400, 424, etc...), Floor, and unit, and if these are all the same, can then enter that figure into the other sheet.
    Last edited by tcy1227; 07-25-2012 at 07:02 PM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro fill cell based on value from another sheet - columns change

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-31-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro fill cell based on value from another sheet - columns change

    Hi patel,

    Thanks for the help and for the macro. Unfortunately, when I entered this into the VB, nothing happened. I will keep looking for a solution, but I appreciate the help, nonetheless. Thanks again...

    ---------- Post added at 07:13 PM ---------- Previous post was at 04:07 PM ----------

    I am not sure if I was clear in my question, but maybe I am missing something with your macro.

    What I am looking for is to be able to enter a value for sales price (column F) in sheet 1 "Values" and have that automatically fill in the sale price in a separate sheet (which corresponds to the building I am working with). For example, F7 is building 400, Floor 1, Unit C. If someone enters a value in F7, can I get that to automatically fill in on the sheet titled "400" in the row with floor 1, unit 7? I'm imagining the macro has to identify 3 values (building, floor, unit) and then find the book and row. Is this possible?

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro fill cell based on value from another sheet - columns change

    My macro can update all the sheets only if you run it.

  5. #5
    Registered User
    Join Date
    10-31-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro fill cell based on value from another sheet - columns change

    Thanks, again much appreciated. That does work great when I run it.

    Is there any way to do it where any value entered in to sale price is automatically updated on the appropriate separate sheet?

  6. #6
    Registered User
    Join Date
    10-31-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro fill cell based on value from another sheet - columns change

    Regarding this macro - I have the following which updates pretty well. But I do have one more question:


    Please Login or Register  to view this content.

    My question is if I want to expand the number of columns that will update, how do I do that. For example, if I want the macro to update based on changes to column s F G H, what changes do I make in the code?
    Last edited by Cutter; 08-02-2012 at 07:00 AM. Reason: Added code tags

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro fill cell based on value from another sheet - columns change

    Please Login or Register  to view this content.
    Last edited by Cutter; 08-02-2012 at 07:00 AM. Reason: Added code tags

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macro fill cell based on value from another sheet - columns change

    Don't forget your code tags, folks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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