I
icestationzbra
hi,
i need some help with this code.
i am trying to check if certain cells in the sheet contain values (the
should not be blank). if any of them do not contain values, i was
checkbox to be placed along that row in a certain column and it shoul
be checked.
my code places a checkbox but does not check it on.
the code i am using is provided below. please debug it for me.
also, is there is a way to turn all the filters to "(All)" at once?
have a sheet where in there is a filter for every column. as soon a
the sheet is activated, i would like for all the columns to be filtere
to "(All)" irrespective of the criterion it had been filtered fo
earlier.
thanks in advance for the help.
mac.
*****
Sub FillCheckBoxes()
Dim rngCells As Range
Dim m As Integer
Dim n As Integer
Sheet2.Select
Range("a1").Activate
ActiveCell.CurrentRegion.Select
n = Selection.Rows.Count
For Each rngCells In Range("Q2:Q" & n)
With rngCells
With Sheet2.CheckBoxes.Add(.Left, .Top, 50, 20)
If ((Sheet2.Range("a" & n).Value = "") _
Or (Sheet2.Range("b" & n).Value = "") _
Or (Sheet2.Range("c" & n).Value = "") _
Or (Sheet2.Range("e" & n).Value = "") _
Or (Sheet2.Range("f" & n).Value = "") _
Or (Sheet2.Range("i" & n).Value = "") _
Or (Sheet2.Range("k" & n).Value = "") _
Or (Sheet2.Range("l" & n).Value = "") _
Or (Sheet2.Range("m" & n).Value = "")) Then
.Value = xlOn
Else
.Value = xlOff
End If
.LinkedCell = rngCells.Address
.Display3DShading = False
End With
End With
Next rngCells
End Su
i need some help with this code.
i am trying to check if certain cells in the sheet contain values (the
should not be blank). if any of them do not contain values, i was
checkbox to be placed along that row in a certain column and it shoul
be checked.
my code places a checkbox but does not check it on.
the code i am using is provided below. please debug it for me.
also, is there is a way to turn all the filters to "(All)" at once?
have a sheet where in there is a filter for every column. as soon a
the sheet is activated, i would like for all the columns to be filtere
to "(All)" irrespective of the criterion it had been filtered fo
earlier.
thanks in advance for the help.
mac.
*****
Sub FillCheckBoxes()
Dim rngCells As Range
Dim m As Integer
Dim n As Integer
Sheet2.Select
Range("a1").Activate
ActiveCell.CurrentRegion.Select
n = Selection.Rows.Count
For Each rngCells In Range("Q2:Q" & n)
With rngCells
With Sheet2.CheckBoxes.Add(.Left, .Top, 50, 20)
If ((Sheet2.Range("a" & n).Value = "") _
Or (Sheet2.Range("b" & n).Value = "") _
Or (Sheet2.Range("c" & n).Value = "") _
Or (Sheet2.Range("e" & n).Value = "") _
Or (Sheet2.Range("f" & n).Value = "") _
Or (Sheet2.Range("i" & n).Value = "") _
Or (Sheet2.Range("k" & n).Value = "") _
Or (Sheet2.Range("l" & n).Value = "") _
Or (Sheet2.Range("m" & n).Value = "")) Then
.Value = xlOn
Else
.Value = xlOff
End If
.LinkedCell = rngCells.Address
.Display3DShading = False
End With
End With
Next rngCells
End Su