GA81848
Board Regular
- Joined
- Apr 25, 2005
- Messages
- 124
I've been using this code I found on this site for some time which has worked well. However, I do have one problem which despite many attempts I cannot resolve.
Currently, this code deletes the whole row if an 'X' is a cell in the appropriate column. Rather than do this I would prefer that it only clears the contents from the row between columns A:G
Could someone help in amending this?
Dim LastRow As Long
Sheets("Data").Select
LastRow = Range("I65536").End(xlUp).Row
Range("AF3").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=IF(RC[-23]="""",""X"","""")"
Selection.Copy
Range("AF3:AF" & LastRow).Select
ActiveSheet.Paste
If Range("I3") <> 0 Then
With Worksheets("Data")
For Each Word In Array("X")
For rw = LastRow To 1 Step -1
On Error Resume Next
.Range("AF" & rw).Find(Word, LookIn:=xlValues).EntireRow.Delete
Next rw
Next Word
End With
Else
End If
Currently, this code deletes the whole row if an 'X' is a cell in the appropriate column. Rather than do this I would prefer that it only clears the contents from the row between columns A:G
Could someone help in amending this?
Dim LastRow As Long
Sheets("Data").Select
LastRow = Range("I65536").End(xlUp).Row
Range("AF3").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=IF(RC[-23]="""",""X"","""")"
Selection.Copy
Range("AF3:AF" & LastRow).Select
ActiveSheet.Paste
If Range("I3") <> 0 Then
With Worksheets("Data")
For Each Word In Array("X")
For rw = LastRow To 1 Step -1
On Error Resume Next
.Range("AF" & rw).Find(Word, LookIn:=xlValues).EntireRow.Delete
Next rw
Next Word
End With
Else
End If