View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Corey Corey is offline
external usenet poster
 
Posts: 363
Default Find and Delete a specified value IF found in cell in ANY Sheets in a WorkBook

I have numerous sheets in a workbook, and have sometimes a numerical value in Cell J59.

I have some code that does some other work for me, but now i need to add a piece of VBA that will
look through ALL sheets int he workbook to see IF Listbox4.value is in Cell J59.
If it is then Delete the value, if not found then do nothing.

I am trying this to no avail:
===========================
Dim wks As Worksheet
For Each wks In ThisWorkbook.Worksheets
On Error Resume Next
If wks.Range("J59").Value = ListBox4.Value Then
wks.Range("J59").Value = ""
End If
Next wks
===========================
ctm....