Hi!
I am trying to find a way to search for a single value (say number or strings) in a shaded range of cells. That, if it found it and I type another value in the same range on another cell, its going to prompt me that I am not allowed to type anything anymore.
Below is the set of codes I tried but I get endless loop. Pls. help. Thank you so much.
'searches for the beginning of the shaded cells
Do While ActiveCell.Interior.ColorIndex = 34
ActiveCell.Offset(-1, 0).Select
Loop
'searches for next shaded cells
If ActiveCell.Interior.ColorIndex = xlNone Then
ActiveCell.Offset(1, 0).Select
End If
If ActiveCell.Interior.ColorIndex = 34 Then
If ActiveCell.FormulaR1C1 <> "" Then
cval = ActiveCell.FormulaR1C1
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
End If
I am trying to find a way to search for a single value (say number or strings) in a shaded range of cells. That, if it found it and I type another value in the same range on another cell, its going to prompt me that I am not allowed to type anything anymore.
Below is the set of codes I tried but I get endless loop. Pls. help. Thank you so much.
'searches for the beginning of the shaded cells
Do While ActiveCell.Interior.ColorIndex = 34
ActiveCell.Offset(-1, 0).Select
Loop
'searches for next shaded cells
If ActiveCell.Interior.ColorIndex = xlNone Then
ActiveCell.Offset(1, 0).Select
End If
If ActiveCell.Interior.ColorIndex = 34 Then
If ActiveCell.FormulaR1C1 <> "" Then
cval = ActiveCell.FormulaR1C1
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
End If