LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
SD SD is offline
external usenet poster
 
Posts: 24
Default Find date in column then delete row???


I have a spreadsheet with a date in cell S5

I want the macro to look down cells S10:S300 and see if the date in S5 is in
any of the columns in S10-A300. If it is I want the found row to be deleted.

I have used this code but it is not working and keeps saying nothing is found.

Dim FindString As String
Dim rng As Range


FindString = Range("s5").Value

If FindString < "" Then
With Sheets("Sheet1").Range("s9:s500")
Set rng = .Find(What:=FindString, _
After:=.Cells(1, 1), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
Application.Goto rng, True
Else
MsgBox "Nothing found"
End If
End With
End If

Can anyone help? Many thanks.
 
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
Find & Delete columns to the left stopping at column B Aria[_2_] Excel Programming 11 May 20th 06 01:48 AM
Find & Delete columns to the left stopping at column B Aria[_2_] Excel Programming 0 May 18th 06 06:48 PM
Find Column heading and then Delete entire column Kobayashi[_58_] Excel Programming 4 October 17th 05 09:09 PM
Find and Delete data in a column rahul_chatterjee[_2_] Excel Programming 4 October 25th 04 11:08 PM
macro to find something in column A and delete 5 rows below it vikram Excel Programming 1 April 30th 04 12:04 PM


All times are GMT +1. The time now is 03:19 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"