Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding a value


Quick question,

I need to create something to go along with or to replace the belo
lines. Basically, I am trying to right a code, that is going to loo
for a person's name, and in this instance it's "Franks, Jinx" and the
automatically delete every row from that point up to Row 7, s
basically it needs to delete everything from Row 8: Cells.Find...if yo
get my drift...any idea's??

Cells.Find(What:="Franks, Jinx", After:=ActiveCell
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext
_
MatchCase:=False, SearchFormat:=False).Activate

Rows("7:159").Select
Range("A159").Activate
Selection.Delete Shift:=xlU

--
dok11
-----------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...fo&userid=1058
View this thread: http://www.excelforum.com/showthread.php?threadid=38013

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Finding a value

Maybe something like:

Option Explicit
Sub testme()

Dim FoundCell As Range

With Worksheets("sheet1")
With .UsedRange
Set FoundCell = Cells.Find(What:="Franks, Jinx", _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

End With

If FoundCell Is Nothing Then
MsgBox "Not found"
Else
If FoundCell.Row 7 Then
.Range("7:" & FoundCell.Row).EntireRow.Delete
End If
End If
End With


End Sub


dok112 wrote:

Quick question,

I need to create something to go along with or to replace the below
lines. Basically, I am trying to right a code, that is going to look
for a person's name, and in this instance it's "Franks, Jinx" and then
automatically delete every row from that point up to Row 7, so
basically it needs to delete everything from Row 8: Cells.Find...if you
get my drift...any idea's??

Cells.Find(What:="Franks, Jinx", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
_
MatchCase:=False, SearchFormat:=False).Activate

Rows("7:159").Select
Range("A159").Activate
Selection.Delete Shift:=xlUp

--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=380137


--

Dave Peterson
Reply
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
Finding 1st,2nd,3rd etc checkQ Excel Discussion (Misc queries) 5 May 19th 08 12:38 AM
Finding non-zero value Tom Stout Excel Discussion (Misc queries) 2 November 21st 07 05:20 PM
Finding the value of x bpiepkorn Excel Worksheet Functions 4 July 26th 07 04:02 PM
Finding Row fak119 Excel Discussion (Misc queries) 3 May 18th 06 05:54 PM
vba..finding first non-zero value in a row Andrew Appel Excel Programming 3 October 20th 03 05:33 AM


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