VB Code not moving to the next line

sassy

New Member
Joined
Feb 23, 2009
Messages
38
Can't get the following code to work as intended. Can anyone tell me what I am missing??

I have a form with checkboxes and when the form is closed, i want it to feed the the designated information from the checked boxes to the sheet skiping over the ones that are not checked. Does this make sense??

It is not moving to the next empty line, it is just going over the B3 again and again.

Code:
Private Sub CloseButton_Click()
If Box_Term.Value = True Then
    Worksheets("CICI").Activate
    Range("B11").Select
    Range("B3:B10").End(xlUp).Offset(1, 0).Select
    Selection.Value = "Term"
Else
End If
If Box_Change.Value = True Then
    Worksheets("CICI").Activate
    Range("B11").Select
    Range("B3:B10").End(xlUp).Offset(1, 0).Select
    Selection.Value = "Add a file"
Else
End If
 
If Box_Lock.Value = True Then
    Worksheets("CICI").Activate
    Range("B11").Select
    Range("B3:B10").End(xlUp).Offset(1, 0).Select
    Selection.Value = "Date Lock"
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Try this.
Code:
    Worksheets("CICI").Range("B" & Rows.Count).End(xlUp).Offset(1) = "Term
 
Upvote 0
Try changing this line:
Code:
Range("B3:B10").End(xlUp).Offset(1, 0).Select
To
Code:
If Range("B3").End(xlDown).Row <> Rows.Count Then Range("B3").End(xlDown).Offset(1, 0).Select
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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