CheckBox Array . . . . I think?

kotting

New Member
Joined
Mar 18, 2002
Messages
17
I have a worksheet where information from inputboxes from another sheet is deposited. I have arranged the information into nice neat rows. The problem is:

I want a checkbox on each row to strikeout the text on that row if the checkbox on that row is 'checked'. There are 365 rows on this worksheet in use. The solution I have requires that each checkbox 'code area' be filled with - (something along the lines of:)

If text is strikeout = true then strikeout =false

else strikeout = true

this works but I have to write a macro for each Checkbox for each row. Is there a way to do this without having to write 365 macros?
Thanks
 
"X" [case sensitive] is the trigger for the copy, if column "A" of that row has a "X" it gets copied. Once copied the "X" is converted to a "*" to let you know what got pasted!

Otherwise, I don't understand your question?
What does B2 have to do with A1?
If A2 is not marked with an "X" it does not get copied.
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Sorry I meant A2,

If the source sheet contains data on B2:B5, and "X"s on A2:A5.
Data on B2:B5 should get copied since they all have an "X" on column A.
But after running the macro only the data from B5 get copied.

Now, If I also include data on C2:C5, then everything get copied.

thanks.

This is what i am using:

Sub Priority()
Application.ScreenUpdating = False
Worksheets("Sheet2").Select
For Each r In Worksheets("Sheet2").UsedRange.Rows
n = r.Row
If Worksheets("Sheet2").Cells(n, 1) = "X" Then
Worksheets("Sheet2").Range(Cells(n, 2), Cells(n, 7)).Copy _
Destination:=Worksheets("Sheet1").Range("B65536").End(xlUp).Offset(1, -1)
Else
End If
Next r

Worksheets("Sheet2").Columns("A").Replace What:="X", Replacement:="*", _
SearchOrder:=xlByColumns, MatchCase:=True

Application.CutCopyMode = True
Application.ScreenUpdating = True

End Sub
 
Upvote 0
I tested this and repaired the code based upon your posted revisions. It should now work for you:

Sub Priority()
Dim myRange As Range, myBot&

Application.ScreenUpdating = False
Worksheets("Sheet2").Select
myBot = Range("A65536").End(xlUp).Row
Set myRng = Range(Cells(1, 1), Cells(myBot, 1))

For Each r In myRng
n = r.Row
If Worksheets("Sheet2").Cells(n, 1) = "X" Then
Worksheets("Sheet2").Range(Cells(n, 2), Cells(n, 7)).Copy _
Destination:=Worksheets("Sheet1").Range("A65536").End(xlUp).Offset(1, 0)
Else
End If
Next r

Worksheets("Sheet2").Columns("A").Replace What:="X", Replacement:="*", _
SearchOrder:=xlByColumns, MatchCase:=True

Application.CutCopyMode = True
Application.ScreenUpdating = True

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

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