#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Find Macro

Hello,

I've written a simple macro that searches column A for whatever the user
inputs in the find dialogue box. I would like to now close the box and
hightlight or select the found row.

Here's what I have so far:

Columns("A:A").Select
Application.Dialogs(xlDialogFormulaFind).Show

Thanks for any help!

--
Message posted via http://www.officekb.com

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Find Macro

Thank you. This does close the dialogue box; is there a way to make it
hightlight/ select the whole row?

Don Guillett wrote:
This might be easier.

Sub findvalue()
ans = InputBox("Search for?")
Columns(1).Find(ans).Select
End Sub

Hello,

[quoted text clipped - 8 lines]

Thanks for any help!


--
Message posted via http://www.officekb.com

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Find Macro

I'm sorry, one more thing also... if it doesn't find what I've entered, can
it return a message to say "Code not found" instead of bringing the debug
editor up?

Thanks again!

Susana C wrote:
Thank you. This does close the dialogue box; is there a way to make it
hightlight/ select the whole row?

This might be easier.

[quoted text clipped - 8 lines]

Thanks for any help!


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200612/1

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Find Macro

Option Explicit
Sub findvalue()
Dim Ans As String
Dim FoundCell As Range
Ans = InputBox("Search for?")
If Trim(Ans) = "" Then
Exit Sub
End If
Set FoundCell = Columns(1).Find(Ans)
If FoundCell Is Nothing Then
MsgBox Ans & " wasn't found"
Else
FoundCell.EntireRow.Select
End If
End Sub


"Susana C via OfficeKB.com" wrote:

I'm sorry, one more thing also... if it doesn't find what I've entered, can
it return a message to say "Code not found" instead of bringing the debug
editor up?

Thanks again!

Susana C wrote:
Thank you. This does close the dialogue box; is there a way to make it
hightlight/ select the whole row?

This might be easier.

[quoted text clipped - 8 lines]

Thanks for any help!


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200612/1


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Find Macro

Thanks Don! You're the best!

Don Guillett wrote:
Sub findvalue()
On Error GoTo nono
ans = InputBox("Search for?")
Columns(1).Find(ans).entirerow.Select
Exit Sub
nono:
MsgBox "not found"
Exit Sub

I'm sorry, one more thing also... if it doesn't find what I've entered,
can

[quoted text clipped - 11 lines]

Thanks for any help!


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200612/1

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
macro to find cell content in sheets and make sheet active Nigel Excel Discussion (Misc queries) 4 June 26th 14 02:38 PM
find last record in macro and delete all after Sherife Excel Discussion (Misc queries) 3 September 18th 06 03:51 AM
Macro to Find & Replace [email protected] Excel Worksheet Functions 2 September 14th 06 07:17 PM
Macro to find and delete rows! Heather O'Malley Excel Discussion (Misc queries) 2 April 12th 06 01:53 PM
Macro - message box if find nothing Frantic Excel-er Excel Discussion (Misc queries) 8 July 1st 05 08:45 PM


All times are GMT +1. The time now is 06:43 PM.

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"