+ Reply to Thread
Results 1 to 6 of 6

Copy row size and clear content to next row

  1. #1
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Copy row size and clear content to next row

    Hallo , could you please assist

    I have a code below that with a attached workbook. The command button "Click to Create New CA Row" when clicked, copies rows 130, 131, 132 to a next open row below row 132. It copies the rows with exact size and keeps the text in rows 13 and 131, it clears row 132's content however.

    There is also drop down boxes through data validation that when then drop down box is selected it allows me to select one certain content that is entered and linked to the top of the document

    The problem I have is that when i click the command button it does not allow me to select the the value in the drop down box, it provides value of the cel below the source cell to which the data validation is set . the second problem is that it copies the command buttons which is correct to the next open rows but duplicates the command button , the more new rows is made the more copies of the command button it creates

    the code is

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Re: Copy row size and clear content to next row

    Hi there, anyone that could provide some advice ?

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy row size and clear content to next row

    Your example Book6 workbook does not have your macro code in it or a "Findings_Summary_Sheet"

    The problem I have is that when i click the command button it does not allow me to select the the value in the drop down box, it provides value of the cel below the source cell to which the data validation is set .
    I didn't understand that.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Re: Copy row size and clear content to next row

    Hi AlphaFrog

    Apologies, I now included the code and also the Finding_Summary_Sheet fro you perusal

    to explain the info in cell E125, E127 / P125, P127 / Q 119, Q 123 is linked to the above inputs through Range B5:N13, these are simply linked through =. So if I would change a site name at the top in Cell C5, it will change the value in cell E125 and so on


    Cell P132 has a data validation with Source being =C5 and so does U132, V,132 W132, X132, Y132, Z132 - These are all data validated through source = to a applicable cell in Range B5:N13

    So what happens now when I click the "CLICK TO CREATE A NEW CA ROW" it

    Firstly - Clears the content of Row 132 (bear in mind once clicked the next clear row would be 135 and so on, depending on how many of those tables I need for corrective actions the code will identify the previous )
    Secondly - It copies a next table to exactly the same size (as rows 130. 131. 132) and formats with Text content of Row 130 and 131 to a second table. Bear in mind there must not be any blank cells in row A132:Z132, else it will not copy, or copies the next table all wrongly


    So here is my problem, when I click the command button "Create a New CA Row" it does all that but if you go to the drop down boxes in Cells as explained above, it is as if the code chooses the next row from the linked cell above - So say the data validation source was = C5, when I click a second "Create New CA Row" the drop down data validation would now be linked to C6 and inserts that value in stead of reaming with the original source I have set the data validation to

    I hope that makes better sense ?
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy row size and clear content to next row

    Change the dropdown source to an absolute cell reference...

    =$C$5

  6. #6
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Re: Copy row size and clear content to next row

    Cool thank you Alpha frog i will try that

+ 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. vba clear content
    By Undo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2019, 03:56 PM
  2. [SOLVED] Clear content referencing another cell's same content
    By papusale in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-08-2015, 05:21 AM
  3. Replies: 3
    Last Post: 03-21-2015, 02:05 AM
  4. [SOLVED] Clear Content in one sheet and copy & paste value from another sheet
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2013, 11:23 AM
  5. Add X# of rows copy formula and clear content
    By angelmoure in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2012, 05:07 PM
  6. Copy and Transfer + Content Clear Row Help VBA Excel 2003
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2012, 11:26 AM
  7. Clear some content of a row
    By Nina07 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-01-2010, 08:37 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