Move row to another worksheet if checked

QualitySoup

New Member
Joined
Jul 14, 2022
Messages
19
Office Version
  1. 365
Platform
  1. Windows
Hi, all

I'm Creating a job board where I need a row moved from a "Working Jobs" spreadsheet to a "completed Jobs" spreadsheet once the checkbox for said row has been checked. Can I get some assistance with this? Thanks!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
I suggest you do not use checkboxes.
1. You will need to install a checkbox on every row
Which to do would require code to do that mostly
Then code would have to be written to determine which checkbox was check and what sheet to move this row to.
It can be done but not by me.

I suggest you double click on column A of your sheet.
And if you double click on "Alpha" this row will be copied to a sheet named "Alpha"
And if you double click on "Bravo" this row will be copied to a sheet named "Bravo"
Now if you want, we can delete the row form the original sheet if you want.
You will see I do have that line of code in my script but if you do not want that remove that line of code.

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
The script runs when you double click on any cell in column A
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Modified  7/15/2022  12:41:36 AM  EDT
If Target.Column = 1 Then
On Error GoTo M
Dim r As Long
Dim ans As String
ans = Target.Value
r = Target.Row
Dim Lastrow As Long
Lastrow = Sheets(ans).Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(r).Copy Sheets(ans).Rows(Lastrow)
Rows(r).Delete
End If
Exit Sub
M:
MsgBox "You double clicked on " & ans & vbNewLine & "This sheet does not exist"
End Sub
 
Upvote 0
Solution
I suggest you do not use checkboxes.
1. You will need to install a checkbox on every row
Which to do would require code to do that mostly
Then code would have to be written to determine which checkbox was check and what sheet to move this row to.
It can be done but not by me.

I suggest you double click on column A of your sheet.
And if you double click on "Alpha" this row will be copied to a sheet named "Alpha"
And if you double click on "Bravo" this row will be copied to a sheet named "Bravo"
Now if you want, we can delete the row form the original sheet if you want.
You will see I do have that line of code in my script but if you do not want that remove that line of code.

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
The script runs when you double click on any cell in column A
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Modified  7/15/2022  12:41:36 AM  EDT
If Target.Column = 1 Then
On Error GoTo M
Dim r As Long
Dim ans As String
ans = Target.Value
r = Target.Row
Dim Lastrow As Long
Lastrow = Sheets(ans).Cells(Rows.Count, "A").End(xlUp).Row + 1
Rows(r).Copy Sheets(ans).Rows(Lastrow)
Rows(r).Delete
End If
Exit Sub
M:
MsgBox "You double clicked on " & ans & vbNewLine & "This sheet does not exist"
End Sub
Hi! Thanks for the answer and support. This is almost exactly the function I'm looking for.

1. I'm not sure if this would be difficult but, would there be a way to make this column "C" instead of "A"?

2. Also, instead of typing "Alpha" into the cell then double clicking to send, would there be a way to select it from a drop down box in the cell then double click?

3. And lastly, this only moved the cell and not the row. Not sure if I'm doing something wrong.
 
Upvote 0
Hi! Thanks for the answer and support. This is almost exactly the function I'm looking for.

1. I'm not sure if this would be difficult but, would there be a way to make this column "C" instead of "A"?

2. Also, instead of typing "Alpha" into the cell then double clicking to send, would there be a way to select it from a drop down box in the cell then double click?

3. And lastly, this only moved the cell and not the row. Not sure if I'm doing something wrong.
Nevermind on question #3. My mistake.
Also, is there a way to only move the values and not the whole row?
 
Upvote 0
You said:
make this column "C" instead of "A"?
Yes, that is possible.

You said:
Also, is there a way to only move the values and not the whole row?

So if you double click on "Alpha" in column C where do you want "Alpha"
entered on sheet named "Alpha" ?
 
Upvote 0
New Update Test.xlsm
ABCDEFGHI
1
2WORKINGCOMPLETEDCONFSENTJOB NUMBERTERMINALMOVEMENTCATEGORYNOTES
3PAS -5559KMI - PASDischargeBargeETS 7/14 ECT
4PAS -5559KMI - PASDischargeBargeETS 7/14 ECT
5PAS -5560KMI - PASDischargeBargeETS 7/14 ECT
6PAS -5561KMI - PASDischargeBargeETS 7/14 ECT
7PAS -5562KMI - PASDischargeBargeETS 7/14 ECT
8PAS -5563KMI - PASDischargeBargeETS 7/14 ECT
9PAS -5564KMI - PASDischargeBargeETS 7/14 ECT
10PAS -5565KMI - PASDischargeBargeETS 7/14 ECT
11PAS -5566KMI - PASDischargeBargeETS 7/14 ECT
12PAS -5567KMI - PASDischargeBargeETS 7/14 ECT
13PAS -5567KMI - PASDischargeBargeETS 7/14 ECT
14PAS -5567KMI - PASDischargeBargeETS 7/14 ECT
15PAS -5567KMI - PASDischargeBargeETS 7/14 ECT
16PAS -5567KMI - PASDischargeBargeETS 7/14 ECT
17PAS -5567KMI - PASDischargeBargeETS 7/14 ECT
18PAS -5567KMI - PASDischargeBargeETS 7/14 ECT
19PAS -5567KMI - PASDischargeBargeETS 7/14 ECT
20PAS -5567KMI - PASDischargeBargeETS 7/14 ECT
WORKING
Cells with Data Validation
CellAllowCriteria
D3:D20ListPAS -,UNI -,- -
F3:F20ListKMI - PAS,ITC - PAS,VPK - DPK,- -
G3:G20ListLoad,Discharge,Transfer,Sample,Submitted,- -
H3:H20ListShip,Barge,Shoretank,Pipeline,- -



So I would like to be able to type (or select from a drop-down) "CONFSENT" in Column "C", double-click it and the values from "C:I" move to "C:I" on worksheet "CONFSENT".
 
Upvote 0
I do not understand this:
You said "C:I"

There is no "C:I"

Do you mean:

Range("C1")
 
Upvote 0
So you want the cells In column C to I copied to the sheet named "CONFSENT"

And where on this sheet are they copies too?
Do we paste them into C to I on sheet named CONFSENT"
So first time copy to row 2 and next time to row 3 and on and on.
 
Upvote 0

Forum statistics

Threads
1,215,358
Messages
6,124,487
Members
449,165
Latest member
ChipDude83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top