vba asistance required.

needhelp2

Active Member
Joined
Apr 19, 2011
Messages
250
Hello Everybody,

Today i am using check box.I had three check box,Each check box have several values,when i check on any single box its value come in b6 till end,but what i need to know that how could i remove them that particular values which relates from that check box only,because while using multiple check box in single time if i uncheck any single box then it removes whole column value instead of his own.

Please assist me how could i handle it?


Regards,
Smith.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
here is my code for 1st check box,
Code:
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
    Range("I6").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Range("A6").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("A6").Select
    Else
    Range(("A6"), Selection.End(xlDown)).Select
    Application.CutCopyMode = ture
    Selection.Clear
    End If

End Sub
what i needs to know how i can remove value only related to his macro as i have many macros and when it uncheck it i removes their values as well.
 
Upvote 0
"Selection.End(xlDown)).Select"
its removes whole data down it,how can memories that it only removes specific value which was copied from ("i6") till down
</pre>
 
Upvote 0
what are the specific set of values that you want the function to remember ???
Is there any pattern in those values so that a common logic can be implemented
 
Upvote 0
hmm i think it would be quite difficult to describe.But Bro tell me how can i mach values from marco,
e.g i had copy values from rang("b5:b10") and place them at ("a5:a10") through check box.
so if i un check checkbox then it mactch values of rang("b5:b10") to ("a5:a10") if found then remove them.Is it possible?
 
Last edited:
Upvote 0
you can use the following code....
put i and j as per the start and the end row....in your case as I have already put, i = 5 and j = 10...you can use whatever you like

Private Sub CheckBox1_Click()
i = 5
j = 10

If CheckBox1.Value = True Then
Range("B" & i & " :B" & j & "").Select
Selection.Copy
Range("A" & i & "").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A" & i & "").Select
Else
Range("A" & i & " :A" & j & "").Select
Application.CutCopyMode = ture
Selection.Clear
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

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