LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default ClearContents if #VALUE! found in cell

Hi All........

This code works fine for a text string as "oldest", but I want it to work if
the cell value is #VALUE! (basically, clear or delete the row is the #VALUE!
error is found)

Dim oldest As String
oldest = Range("data!k1").Value 'value is a text string
With Sheets("ALL12")
lastrow = .Cells(.Rows.Count, "a").End(xlUp).Row
For r = lastrow To 12 Step -1

If .Cells(r, "b").Value Like oldest Then
.Rows(r).EntireRow.ClearContents
End If
Next r
End With

Any help would be much appreciated.......

Vaya con Dios,
Chuck


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vb code to clearcontents of a merged cell MitzDriver Excel Programming 8 October 23rd 09 10:10 PM
ClearContents Paul Dennis Excel Programming 2 September 11th 07 02:58 PM
Find * in a cell & ClearContents Roger Excel Programming 6 March 11th 07 09:09 PM
Change the appearance cell where Find criteria is found in a cell Tomszar Excel Discussion (Misc queries) 3 December 30th 05 02:48 PM
clearcontents, worksheet_change, cell validation Jan Excel Programming 2 January 26th 05 05:11 AM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"