Barryj
01-16-2009, 08:21 PM
I need this code to delete contents in the row when a match, not delete the row as some of the rows are linked to other sheets.
I tried changing this line of code
cell.entirerow.delete
for
cells.entirerow.clearcontents
But this is not clearing the entire row only the match in column A
Any thoughts
Private Sub CommandButton1_Click()
Dim sh As Worksheet
Dim cell As Range
For Each sh In Worksheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet5", "Sheet6"))
Set cell = Nothing
Set cell = sh.Columns(1).Find(Me.ComboBox1.Value)
If Not cell Is Nothing Then
cell.EntireRow.Delete
End If
Next sh
End Sub
Thanks for any help.
I tried changing this line of code
cell.entirerow.delete
for
cells.entirerow.clearcontents
But this is not clearing the entire row only the match in column A
Any thoughts
Private Sub CommandButton1_Click()
Dim sh As Worksheet
Dim cell As Range
For Each sh In Worksheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet5", "Sheet6"))
Set cell = Nothing
Set cell = sh.Columns(1).Find(Me.ComboBox1.Value)
If Not cell Is Nothing Then
cell.EntireRow.Delete
End If
Next sh
End Sub
Thanks for any help.