+ Reply to Thread
Results 1 to 8 of 8

If formula copied down

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    If formula copied down

    I have the attached spreadsheet and in column L in contains a very simple If formula. I have copied it down but is there a way I can use VBA to put the formula in automatically. I wouldn’t want to have to press a button for it to then enter the formulas, I would want excel to do it automatically as soon as data is put in column C

    The code would need to find the last cell that contains data.
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: If formula copied down

    I've just entered some new data in row 15 of your sheet and Excel automatically filled in the formula in column L.

    See if your setup has the following tick box checked:

    Tools - options - Edit tab - Enable AutoComplete for cell values

    As an alternative, in XL2003 you can make your data table into an Excel List, (click somewhere in the table, then go Data - Lists - Create List
    This will put a blue border around the data table and when you enter a new row at the bottom or insert a row in between, formulas and formatting will be applied as in the rest of the list. In Excel 2007 you can insert a Table.

    Your profile does not state what version of Excel you're using. You may want to provide that information if you need more help.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: If formula copied down

    Hello pauldaddyadams,

    The macro below will add the "If" formula to the row when the cell in column "C" changes. This has been added to the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If formula copied down

    I vote for the "List" feature as well. Very, very handy function once you start using it.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: If formula copied down

    I would rather not use a list as the spreadsheet will be creating new sheets automatically and each list range will vary.

    Regarding the VB Code - i couldnt get it to work?

    Also looking at the formula I believe it will place the wrong formula, I need
    Please Login or Register  to view this content.

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: If formula copied down

    I would rather not use a list as the spreadsheet will be creating new sheets automatically and each list range will vary.
    Are you sure you understand the Excel 2003 List concept? You may want to consult the Excel Help files to see that each sheet can have its own list and that it's quite dynamic.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: If formula copied down

    Also, in the Tools ->Options->Edit tab make sure that "Extend data range formats & formulas" is checked. This should do what you want in all tables. No point in using VBA when Excel has inbuilt functions to achieve the result
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  8. #8
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: If formula copied down

    I got the list feature to work thanks, Ill look into weather I can use it on my spreadsheet or not.

    Is there a way I can have a macro so that the user form can be brought up ready for new entries? I tried:

    Please Login or Register  to view this content.
    But this didnt work.

    Also, I have two date fields. Is there any way I can have a pop up calendar rather than for the user to input manually? I have a pop up calendar on a different part of the spreadsheet so the form is already created, its called frmcalendar

+ 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