Checkbox to send values to first empty row on another sheet

csimpson24

New Member
Joined
Feb 22, 2018
Messages
22
Hi all,

I have added a checkbox, CheckBox1, to a sheet. When checked, I am trying to send the values of E29 and D29 to the first empty row, to columns A and C on a sheet called Sample.

Any help would be greatly appreciated.

Thanks,
Chris
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Try this:
Put this script in CheckBox1

I assume CheckBox1 is in same sheet as Range("E29") and Range("D29") are
Code:
Private Sub CheckBox1_Click()
'Modified  6/10/2019  3:46:40 PM  EDT
    If CheckBox1.Value = True Then
        Dim Lastrowa As Long
        Lastrowa = Sheets("Sample").Cells(Rows.Count, "A").End(xlUp).Row + 1
        Dim Lastrowc As Long
        Lastrowc = Sheets("Sample").Cells(Rows.Count, "C").End(xlUp).Row + 1
        Sheets("Sample").Cells(Lastrowa, "A").Value = ActiveSheet.Range("E29").Value
        Sheets("Sample").Cells(Lastrowc, "C").Value = ActiveSheet.Range("D29").Value
        CheckBox1.Value = False
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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