#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 111
Default "find" macro

i have tried recording a macro using the Find feature. i want to find a line
that contains "net cash provided (used) by operating activities" and delete
it. however, the macro doesn't record the "find" key strokes, only the
delete ones. saw a similiar post on 8/22/07 from Chad and copied his macro
but get error messages.

thanks in advance for your help.

by the way, when i click on the email notification that someone has
responded to my question, i get a blank screen that says "Done" in the bottom
left corner. then i have to go to the web site and try to find my question
and the response. what's going on?

thanks for this too
--
aprilshowers
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default "find" macro

It recorded fine for me.

But I'm not sure what should happen with that found cell. Does delete mean
delete the entire row or column or clear the cell or just clear the contents of
that cell or what???

This may get you started:

Option Explicit
Sub testme()

Dim FoundCell As Range
Dim myStr As String

myStr = "net cash provided (used) by operating activities"

With ActiveSheet
Set FoundCell = .Cells.Find(What:=myStr, _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If FoundCell Is Nothing Then
MsgBox "Not found!"
Else
FoundCell.Clear
'or
FoundCell.ClearContents
'or
FoundCell.EntireRow.Delete
End If
End With
End Sub

april wrote:

i have tried recording a macro using the Find feature. i want to find a line
that contains "net cash provided (used) by operating activities" and delete
it. however, the macro doesn't record the "find" key strokes, only the
delete ones. saw a similiar post on 8/22/07 from Chad and copied his macro
but get error messages.

thanks in advance for your help.

by the way, when i click on the email notification that someone has
responded to my question, i get a blank screen that says "Done" in the bottom
left corner. then i have to go to the web site and try to find my question
and the response. what's going on?

thanks for this too
--
aprilshowers


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 111
Default "find" macro

"delete" means delete the row. i tried several times and couldn't get the
"find" strokes to record.

have just re-tried this. the strokes record if you click "find next" since
there was only one instance of that phrase, i didn't hit "find next"

thanks for your help--
aprilshowers


"Dave Peterson" wrote:

It recorded fine for me.

But I'm not sure what should happen with that found cell. Does delete mean
delete the entire row or column or clear the cell or just clear the contents of
that cell or what???

This may get you started:

Option Explicit
Sub testme()

Dim FoundCell As Range
Dim myStr As String

myStr = "net cash provided (used) by operating activities"

With ActiveSheet
Set FoundCell = .Cells.Find(What:=myStr, _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If FoundCell Is Nothing Then
MsgBox "Not found!"
Else
FoundCell.Clear
'or
FoundCell.ClearContents
'or
FoundCell.EntireRow.Delete
End If
End With
End Sub

april wrote:

i have tried recording a macro using the Find feature. i want to find a line
that contains "net cash provided (used) by operating activities" and delete
it. however, the macro doesn't record the "find" key strokes, only the
delete ones. saw a similiar post on 8/22/07 from Chad and copied his macro
but get error messages.

thanks in advance for your help.

by the way, when i click on the email notification that someone has
responded to my question, i get a blank screen that says "Done" in the bottom
left corner. then i have to go to the web site and try to find my question
and the response. what's going on?

thanks for this too
--
aprilshowers


--

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
"Find" a wildcard as a place marker and "replace" with original va Eric Excel Discussion (Misc queries) 1 January 27th 09 06:00 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Macro to find copy "header" and paste RunsWithKnives Excel Discussion (Misc queries) 3 March 27th 06 05:55 AM


All times are GMT +1. The time now is 05:44 AM.

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

About Us

"It's about Microsoft Excel"