+ Reply to Thread
Results 1 to 6 of 6

Can I automatically add lines depending on value in cell

  1. #1
    Forum Contributor
    Join Date
    12-30-2021
    Location
    Mount Gambier, Australia
    MS-Off Ver
    Microsoft Office Home and Student 2019
    Posts
    117

    Can I automatically add lines depending on value in cell

    Is there a way I can put a value in a cell (say 88) and then have excel automatically add that many lines after the first.

    For example

    If cell A10 has 1/1/21 and I enter 88 in cell E5
    can I get excel to add dates in column A for 88 days?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,215

    Re: Can I automatically add lines depending on value in cell

    Yes.

    In A11:

    =IF((A10+1)>E$5,"",A10+1)

    Drag down as far as you want.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    12-30-2021
    Location
    Mount Gambier, Australia
    MS-Off Ver
    Microsoft Office Home and Student 2019
    Posts
    117

    Re: Can I automatically add lines depending on value in cell

    Thank you again AliG. You make it sound simple lol

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,215

    Re: Can I automatically add lines depending on value in cell

    Been at it for years!

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,672

    Re: Can I automatically add lines depending on value in cell

    As an alternative, see if this VBA solution works for you

    Please Login or Register  to view this content.
    How to install your new code
    • Copy the Excel VBA code
    • Select the workbook in which you want to store the Excel VBA code
    • Press Alt+F11 to open the Visual Basic Editor
    • Choose Insert > Module
    • Edit > Paste the macro into the module that appeared
    • Close the VBEditor
    • Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)


    To run the Excel VBA code:
    • Press Alt-F8 to open the macro list
    • Select a macro in the list
    • Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Forum Contributor
    Join Date
    12-30-2021
    Location
    Mount Gambier, Australia
    MS-Off Ver
    Microsoft Office Home and Student 2019
    Posts
    117

    Re: Can I automatically add lines depending on value in cell

    Thanks Alan but I get myself in a huge mess when I start trying to use 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. Automatically change color of timesheet lines depending on working hours
    By jujuby in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-02-2021, 01:02 AM
  2. [SOLVED] Automatically deleting and moving a row to new sheet depending on cell value
    By MissCofnchtr in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-11-2017, 01:54 PM
  3. [SOLVED] Automatically format number of cells below selected cell depending on value in cell.
    By odin78 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-15-2017, 05:10 PM
  4. add lines with changing formulas depending on lines in another worksheet
    By fragger224 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2015, 05:15 AM
  5. Show or hide several lines depending on 1 cell.
    By Simon-ch in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-19-2008, 12:47 PM
  6. Start automatically a mcro depending on the value in the cell
    By tromao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2007, 12:11 PM
  7. Automatically Colouring a cell depending on the value in it
    By help-needed in forum Excel General
    Replies: 3
    Last Post: 01-15-2007, 10:56 AM

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