Thread
:
Useing If to Delete a Range
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Useing If to Delete a Range
work from the BOTTOM up. Something like
mc="bd"
for i = cells(rows.count,mc).end(xlup).row to 2 step -1
if cells(i,mc)<=32 then range(cells(i,"c"),cells(i,"bb")).clearcontents
next i
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"ytayta555" wrote in message
...
HY ALL !
My big problem is the next : I work in a whole
worksheet ,[ from cell 91 to cell 65536 ] ; I have need a
macro which to ClearContents of Range ,,C91:BB91,,
if the value of cell BD91 < = 32 ; then next row , the
same problem : if BD92 < = 32 , then , to delete ,,the Range" :
,,C92:BB92,, ; then , next row , and so on , from Row 91 to Row
65536 . Please very much to help me !
The macro can look like this [ I write this for pattern ] ,
but how can I modify it ?
Sub Macrocomanda3()
Dim Row As Integer, Col As Integer
For Col = 1 To 4
For Row = 1 To 10
If ActiveSheet.Cells(Row, Col) = 1 Then
ActiveSheet.Cells(Row, Col).ClearContents
Next Row
Next Col
End Sub
RESPECTFULLY TO ALL !
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett