ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   "find" macro (https://www.excelbanter.com/excel-discussion-misc-queries/239486-find-macro.html)

april

"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

Don Guillett

"find" macro
 
As ALWAYS, post your macro for comments and suggestions.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"april" wrote in message
...
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

"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

april

"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



All times are GMT +1. The time now is 11:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com