+ Reply to Thread
Results 1 to 8 of 8

Enter Formula on Multiple Locations using Macros

  1. #1
    Registered User
    Join Date
    07-19-2009
    Location
    New Yoek
    MS-Off Ver
    Excel 2003
    Posts
    35

    Enter Formula on Multiple Locations using Macros

    Hi Guys,

    I have the following
    Please Login or Register  to view this content.
    which gives me a location name along with that locations maximum value.

    The formula looks for a condition met from column G, matches it to column AC and then gives me the result from column K , here is the formula
    Please Login or Register  to view this content.
    What i need is to be able to insert that same formula by first looking down column G next available empty row and once it finds it insert the formula on column E and F one row below where the empty row is first found from column g.

    Sounds , I can manually enter formula then copy paste in the proper row and column but the problem I have others will be using this worksheet and I wanted to this automated.

    Thanks...
    Attached Files Attached Files
    Last edited by Leith Ross; 07-20-2009 at 03:30 AM. Reason: Addded Code Tags

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Enter Formula on Multiple Locations using Macros

    please put code tags around code! it makes it easier to read and is in the forum rules.
    Please Login or Register  to view this content.
    if thats not the right cells adjust offset ,as it stands if last used cell is G25
    then first formula is put in E27 second in F28
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-19-2009
    Location
    New Yoek
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Enter Formula on Multiple Locations using Macros

    Thanks, I forgot to to wrap in code tags.

    This seems to place the formulas and the very end of the data column. It does not find the empty rows in between.

    I wanted to be able to start off and insert the data from the very beginning, which will be Column E row 27 and column F row 27. From there the macro will look at the next empty row from column G and insert the formulas in column E and F and continue to do this until it inserts the formulas .

    Column G will have data but every so often it will have an empty row to separate one set of data from another.

    Thanx
    Last edited by Preatorian; 07-20-2009 at 02:46 PM.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: Enter Formula on Multiple Locations using Macros

    If I've understood correctly, I think this is what you want:
    Please Login or Register  to view this content.
    Note that your lookup formula does not actually need to be entered as an array formula.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Registered User
    Join Date
    07-19-2009
    Location
    New Yoek
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Enter Formula on Multiple Locations using Macros

    Wow, great, thanks.It works like a dandy.

    Just one question, how can I make it to stop a a certain row number. Right now my last row with data is row 200 on column G but the macro writes down to row 400.

    Is it because I have data in row 400 but only on column AC?

    I only have data in Column G row 200.

    Can this be changed.

    Thanx, looks like I found the right forum for my questions and answers.
    Last edited by shg; 07-20-2009 at 02:20 PM. Reason: deleted spurious quote

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Enter Formula on Multiple Locations using Macros

    Preatorian, please don't quote whole posts. It's just clutter.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: Enter Formula on Multiple Locations using Macros

    This part:
    Please Login or Register  to view this content.
    looks for the last cell in column G with something in it. If it's writing down to row 400, then there is something in G400.

  8. #8
    Registered User
    Join Date
    07-19-2009
    Location
    New Yoek
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Enter Formula on Multiple Locations using Macros

    Yep, you are absolutely right. There was a ( . ) on G400. Did not even see it.
    Thanx for your help freind....

+ 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