Hello. A few days ago, someone assisted me in creating a macro that enabled me to copy certain cells from one sheet to another when a check box was ticked. Works like a charm.
I have another workbook where I want to do something similar. I thought I could easily substitute spreadsheet names and cell ranges to make the same macro work here. But I've not been successful. Attached is a shell of the workbook I'm working on now. Check boxes are there. This time I have several sheets and want specific cells from any checked rows on any of the sheets to move to the "programs requested" sheet at the end. I tried doing it with the first sheet (Brockton) as a test and had no luck. Here is the language below....Getting run time errors, among others. FYI, the cells I would like moved over when checked are A,B,D,N,P,R and S.
Could someone assist me?
Thank you!
Sub Brock()
Dim rng As Range
Dim crng As Range
Set crng = Sheets("Brockton").Range("T3:T21")
For Each cell In crng
Set rng = Sheets("Programs requested").Range("A1").End(xlDown).Offset(1, 0)
If cell.Value = True And Application.CountIf(Sheets("Brockton").Range("A:A"), cell.Offset(0, -7).Value) = 0 Then
rng.Value = cell.Offset(0, -7)
rng.Offset(0, 1).Value = cell.Offset(0, -6)
rng.Offset(0, 2).Value = cell.Offset(0, -5)
rng.Offset(0, 3).Value = cell.Offset(0, -4)
rng.Offset(0, 4).Value = cell.Offset(0, -3)
End If
Next cell
End Sub
Bookmarks