+ Reply to Thread
Results 1 to 8 of 8

When all checkboxes are checked move row to first available row on sheet 2

Hybrid View

  1. #1
    Registered User
    Join Date
    05-25-2021
    Location
    Michigan, US
    MS-Off Ver
    MS 365
    Posts
    37

    When all checkboxes are checked move row to first available row on sheet 2

    Is it possible to have a row move from Sheet 1 to Sheet 2 once all checkboxes are checked? I figured out how to do this with drop downs but the ease of clicking the checkbox will save some time in the long run.

    Sample book is attached..

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: When all checkboxes are checked move row to first available row on sheet 2

    Where your checkboxes are ?
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    05-25-2021
    Location
    Michigan, US
    MS-Off Ver
    MS 365
    Posts
    37

    Re: When all checkboxes are checked move row to first available row on sheet 2

    I didn't add any because I wasn't sure if it would just make helping me harder.

    I can add them and reupload the workbook.. but in all of the cells the 3 empty columns to the far right.

  4. #4
    Registered User
    Join Date
    05-25-2021
    Location
    Michigan, US
    MS-Off Ver
    MS 365
    Posts
    37

    Re: When all checkboxes are checked move row to first available row on sheet 2

    Here's one with checkboxes.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,252

    Re: When all checkboxes are checked move row to first available row on sheet 2

    Or maybe without CheckBoxes? By double clicking in columns F:H.
    Procedure in the Sheet1 module (not in stadard module):
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Not Intersect(Target, Me.Columns("F:H")) Is Nothing Then
            If Target.Row > 1 Then
                Application.EnableEvents = False
                Cancel = True
    
    
                If Len(Target.Value) = 0 Then
    
                    If Target.Column > 6 Then
                        If Target.Offset(, -1).Value <> Chr(252) Then
                            MsgBox "Previous procedure not performed!", vbExclamation
                            GoTo ExitProc
                        End If
                    End If
    
                    With Target
                        .Value = Chr(252)
                        .Font.Name = "Wingdings"
                        .Font.Size = 12
                        .Font.Color = 5287936
                    End With
    
                Else
                    Target.ClearContents
                End If
    
    
                If Application.CountA(Me.Cells(Target.Row, "F").Resize(, 3)) = 3 Then
                    MsgBox "All three procedures performed. You can move the range " & Me.Cells(Target.Row, "A").Resize(, 5).Address & " to another sheet."
                End If
    
    ExitProc:
                Application.EnableEvents = True
            End If
        End If
    End Sub
    Artik

  6. #6
    Registered User
    Join Date
    05-25-2021
    Location
    Michigan, US
    MS-Off Ver
    MS 365
    Posts
    37

    Re: When all checkboxes are checked move row to first available row on sheet 2

    Atrik this works brilliantly -- Is there anyway to move the completed range automatically to another sheet in the first available row once all are double clicked?

  7. #7
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,252

    Re: When all checkboxes are checked move row to first available row on sheet 2

    I thought you had this part of the macro ready when I read "I figured out how to do this with drop downs ...".
    After changes
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Not Intersect(Target, Me.Columns("F:H")) Is Nothing Then
            If Target.Row > 1 Then
                Application.EnableEvents = False
                Cancel = True
    
    
                If Len(Target.Value) = 0 Then
    
                    If Target.Column > 6 Then
                        If Target.Offset(, -1).Value <> Chr(252) Then
                            MsgBox "Previous procedure not performed!", vbExclamation
                            GoTo ExitProc
                        End If
                    End If
    
                    With Target
                        .Value = Chr(252)
                        .Font.Name = "Wingdings"
                        .Font.Size = 12
                        .Font.Color = 5287936
                    End With
    
                Else
                    Target.ClearContents
                End If
    
    
                If Application.CountA(Me.Cells(Target.Row, "F").Resize(, 3)) = 3 Then
    
                    If MsgBox("All procedures performed. You can move the range " & _
                              Me.Cells(Target.Row, "A").Resize(, 5).Address & " to Archive sheet." & _
                              String(2, vbLf) & "Are you sure you want to do?", _
                              vbQuestion + vbYesNo + vbDefaultButton2, "Procedures complete") = vbYes Then
    
                        Call Archiving(Me.Cells(Target.Row, "A").Resize(, 5))
                    End If
    
                End If
    
    ExitProc:
                Application.EnableEvents = True
            End If
        End If
    End Sub
    
    
    
    Private Sub Archiving(Source As Range)
        Dim wks         As Worksheet
        Dim lRow        As Long
    
        Set wks = Worksheets("Sheet2")
        lRow = wks.Cells(Rows.Count, "A").End(xlUp).Row + 1
    
        With Source 
            wks.Cells(lRow, "A").Resize(, .Columns.Count).Value = .Value
            .EntireRow.Delete
        End With
    
    End Sub
    Artik

  8. #8
    Registered User
    Join Date
    05-25-2021
    Location
    Michigan, US
    MS-Off Ver
    MS 365
    Posts
    37

    Re: When all checkboxes are checked move row to first available row on sheet 2

    Ah yes, it looks similar to what I came up with but comparing yours to mine I can see where mine is lacking.
    I appreciate you taking the time, again.. to solve my issue! Artik, you're brilliant!

+ 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. [SOLVED] Move a row checked to another sheet
    By deezywonder in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-22-2020, 08:14 AM
  2. Run macro only after several checkboxes have been checked.
    By hk57 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2020, 02:46 AM
  3. Uncheck all checkboxes which are checked on
    By paradise2sr in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-08-2019, 09:54 AM
  4. Summing checked checkboxes
    By bermudamohawk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2014, 11:25 AM
  5. Replies: 4
    Last Post: 12-30-2013, 10:10 AM
  6. Using Checkboxes to move rows to another sheet
    By mtlane in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2012, 02:20 PM
  7. My checkboxes will not stay checked.
    By NUMBnut in forum Excel General
    Replies: 0
    Last Post: 01-09-2006, 05:10 PM

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