+ Reply to Thread
Results 1 to 6 of 6

Adding A Certain Number of Rows w/ Prefilled Cells

  1. #1
    Registered User
    Join Date
    07-30-2020
    Location
    Charleston, SC
    MS-Off Ver
    Office 365
    Posts
    30

    Question Adding A Certain Number of Rows w/ Prefilled Cells

    I am hoping to automate my spreadsheet to add rows as needed for testing upon failure.
    In my example, if my result hits 0.19 or higher, I need it to add a number of rows equal to the value of the sample number that failed. Following the example, since row 6 was 0.2, it added 6 rows and prefilled the Sample Number cells with the equation to determine the sample number.
    I understand macros in theory, but I'm not sure how to piece all of this together. I appreciate any help you can provide!
    Attached Files Attached Files

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Adding A Certain Number of Rows w/ Prefilled Cells

    Can you show the sample result for this list?

    Sample Number Result
    1 0.188
    2 0.190
    3 0.188
    4 0.191
    5 0.187
    6 0.200
    7 0.155
    8
    多么想要告诉你 我好喜欢你

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,862

    Re: Adding A Certain Number of Rows w/ Prefilled Cells

    How about such code in Sheet1:

    Please Login or Register  to view this content.
    If numbered rows shall be added also for 0.19 sharp, then change > into >= in the condition
    Attached Files Attached Files
    Best Regards,

    Kaper

  4. #4
    Registered User
    Join Date
    07-30-2020
    Location
    Charleston, SC
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Adding A Certain Number of Rows w/ Prefilled Cells

    This made me realize a problem with my logic, thank you. I need it to have a total of 10 blanks following a failure, which works if it fails once, but not multiple times. Is there a way for it to count the remaining spaces then add enough to get it back up to 10 spaces following any failure? To use Millz example inquiry:
    Sample Number Result
    1 0.188
    2 0.190
    3 0.188
    4 0.191
    5 0.187
    6 0.200
    7 0.155
    8
    9
    10
    11
    12
    13
    14
    15
    16

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,862

    Re: Adding A Certain Number of Rows w/ Prefilled Cells

    Probably even a shorter/easier code:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-30-2020
    Location
    Charleston, SC
    MS-Off Ver
    Office 365
    Posts
    30

    Re: Adding A Certain Number of Rows w/ Prefilled Cells

    This is perfect, thank you!

+ 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. Macro for prefilled message
    By atomichybrid in forum Outlook Formatting & Functions
    Replies: 3
    Last Post: 07-11-2020, 02:51 PM
  2. [SOLVED] Adding Number Of 'YES' Cells For Rows Of The Same Date
    By Hurg in forum Excel General
    Replies: 3
    Last Post: 06-18-2020, 05:24 AM
  3. Replies: 7
    Last Post: 01-20-2020, 01:02 PM
  4. Replies: 13
    Last Post: 07-16-2016, 10:53 PM
  5. Counting the number of matched cells and adding it to a different number...
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2015, 02:51 PM
  6. [SOLVED] Prefilled userform
    By Oeysbrei in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2012, 01:35 PM
  7. Adding Set number of rows according to cell value
    By m40wen in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 01-19-2007, 07:43 AM

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