How to manipulate a row with a certain value
Can't write anything specific to your situation with no details, however, as
an example, this macro would find the cell (assuming there is only one cell)
in the range B11:C16, then clear the cell to the left through the fifth cell
from the right. So if B14 contained 5, then A14:G14 would be cleared. The
find method has additional arguments (you can find them in VBA help file).
If you can have multiple matches you may be able to set up a loop, or use
FindNext (just ideas - you'll need to play with it to see what works best for
you).
Sub test()
Const x As Long = 5
Dim Rng As Range
Set Rng = Range("B11:C16").Find(what:=x)
With Rng
Range(.Offset(0, -1), .Offset(0, 5)).Clear
End With
End Sub
"Bill" wrote:
I am trying to look for a variable value in a range, select part of the row
that value is in, and clear that selection.
Seems straightforward and I cannot for the life of me get it.
Help!
Thanks
|