+ Reply to Thread
Results 1 to 2 of 2

Using checkboxes to copy rows from one sheet to another in the same relative order

  1. #1
    Registered User
    Join Date
    08-31-2017
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    1

    Using checkboxes to copy rows from one sheet to another in the same relative order

    Hi everyone,

    I'm fairly new to VBA so this doesn't seem obvious to me at the moment.

    My company is using a workbook where Sheet1 contains details of about 1000 documents, one on each row. Some of these documents are the "latest" versions and these have a check mark next to them, using checkboxes. We are trying to use Checkboxes to copy the rows that have a check mark from Sheet1 to Sheet2, where Sheet2 is meant to summarise these "latest" versions of the documents from Sheet1.
    The problem is that if we insert a new row in Sheet1 somewhere in the middle of the worksheet and I insert a checkbox into that row which I then check mark, the row will be inserted as the LAST ROW of Sheet2. I need the row to be inserted in the same relative order as they appear in Sheet1.

    Here is the code that I am currently using:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    This works well, until I need to add another row somewhere in the middle of sheet 1, which has a check mark. Then the row will be added at the end of sheet 2, instead of the order in which it appears in sheet1. The problem lies with the fact that Checkboxes are given an unique number which is in order of when they were placed in the sheet. If I remove all the checkboxes using the RemoveCheckboxes subroutine, then add them again using AddCheckboxes, then this will "solve" this problem but all the checkboxes will be cleared, and I have hundreds of checkboxes that will need to be checked again manually.

    Does anyone have a solution to this problem?

    Thank you very much.
    Last edited by alansidman; 08-31-2017 at 07:02 PM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Using checkboxes to copy rows from one sheet to another in the same relative order

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    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

+ 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. Replies: 4
    Last Post: 12-02-2014, 03:46 AM
  2. Replies: 1
    Last Post: 12-01-2014, 03:01 PM
  3. [SOLVED] copy all highlighted rows to new sheet in order
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2014, 02:21 PM
  4. Copy range of rows and checkboxes downwards
    By rudrugis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2013, 11:01 AM
  5. Macro which will copy rows of data, in same order from one sheet, to another sheet!
    By WaylettChris in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-23-2013, 02:02 PM
  6. Copy rows based on criteria into new sheet, but not in the same sequential order
    By kmsosaka in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-04-2010, 02:56 AM
  7. hidding rows with checkboxes and coping visible rows to another sheet
    By aviflux in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-15-2008, 09:35 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