VBA CheckBox to copy and past values from one sheet to another

sloany101

New Member
Joined
Jan 7, 2023
Messages
35
Office Version
  1. 365
Thanks for any help , it is needed, i have searched and tried to find some code to make my own but have no luck so i am looking to this forum yet again for help.

So what i am looking to do is to simply copy values of a cell and paste the value in another cell on a separate work sheet using checkboxes in a multipage userform attached to a command button, it is used to check a person in our out , it will copy from a "Daily POB" and paste in a "Arrivals-Departures" sheet there are 2 different series of columns on the arrivals-departures sheet one being arrivals and the other being departures , so in the user form i will have a multipage box pop up page 1 will be arrival and page 2 will be departure , and in each page will be 62 check boxes and when you check for example #1 it will copy and paste the value of the name of the personnel associated with that number on the POB to either arrival/departure in the arrivals/departures sheet , now the part that is evading me is how to make it paste the values skipping non empty cells and pasting to the next empty one .

so for reference for check box #1 i want to copy the value of cell C3 on the sheet labeled "Daily POB" and paste to the next empty cell on sheet labeled "Arrivals-Departures" in a range of cells C5:C49

any help is appreciated , if more info needed i will do my best to provide it, thanks in advance.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
If any one has seen this and started working on it i appreciate it but i have figured it out code was inputed into a multipage userform with check boxes attached to a command button .

VBA Code:
Private Sub CheckBox1_Click()
Application.ScreenUpdating = False
Dim EmtC As Long
Sheets("Daily POB").Range("C3").Copy
With Sheets("Arrivals-Departures")
    EmtC = .Range("C" & Rows.Count).End(xlUp).Row + 1
    .Range("C" & EmtC).PasteSpecial paste:=xlPasteValues
End With
Sheets("Daily POB").Range("A3").Copy
With Sheets("Arrivals-Departures")
    EmtC = .Range("E" & Rows.Count).End(xlUp).Row + 1
    .Range("E" & EmtC).PasteSpecial paste:=xlPasteValues
End With
Sheets("Daily POB").Range("F3").Copy
With Sheets("Arrivals-Departures")
    EmtC = .Range("D" & Rows.Count).End(xlUp).Row + 1
    .Range("D" & EmtC).PasteSpecial paste:=xlPasteValues
End With
Sheets("Arrivals-Departures").Select

Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub


this is what i got and actually works pretty good , just will be a little tedious applying it to 124 individual check boxes lol but ill get it.
 
Last edited by a moderator:
Upvote 0
Solution
Thanks for letting us know that you have a solution and for posting the code. (y)
However, when posting vba code in the forum, please use the available code tags. It makes your code much easier to read/debug & copy.
My signature block below has more details. I have added the tags for you this time. 😊
 
Upvote 0
Noted Peter, thanks , well i have hit another snag in this , the original copy paste method using check boxes works but now i am trying to apply it to a different sheet , it his a helicopter manifest builder its supposed to work like the other one in this thread works but the problem i have is there are 4 different sections on the one sheet for 1st 2nd 3rd and 4th flights which all start at a different range of cells

this is the initial modified code for this that i have , it wants to paste everything to one cell B21
C3 copy needs to start at G21 , J3 copy needs to start at C21 , F3 copy needs to start at H21, K3 copy needs to start at D21 when pasting to the manifest sheet, im a little stuck on this any help is appreciated

VBA Code:
Private Sub CheckBox3_Click()
Application.ScreenUpdating = False
Dim EmtC As Long
Sheets("Daily POB").Range("C3").Copy
With Sheets("Manifest Builder")
    EmtC = .Range("G" & Rows.Count).End(xlUp).Row + 1
    .Range("G21:G" & EmtC).PasteSpecial Paste:=xlPasteValues
End With
Sheets("Daily POB").Range("J3").Copy
With Sheets("Manifest Builder")
    EmtC = .Range("C" & Rows.Count).End(xlUp).Row + 1
    .Range("C21:C" & EmtC).PasteSpecial Paste:=xlPasteValues
End With
Sheets("Daily POB").Range("F3").Copy
With Sheets("Manifest Builder")
    EmtC = .Range("H" & Rows.Count).End(xlUp).Row + 1
    .Range("H21:H" & EmtC).PasteSpecial Paste:=xlPasteValues
End With
Sheets("Daily POB").Range("K3").Copy
With Sheets("Manifest Builder")
    EmtC = .Range("D" & Rows.Count).End(xlUp).Row + 1
    .Range("D21:D" & EmtC).PasteSpecial Paste:=xlPasteValues
End With
Sheets("Manifest Builder").Select

Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,120
Members
453,021
Latest member
Justyna P

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