Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find Macro
This might be easier.
Sub findvalue() ans = InputBox("Search for?") Columns(1).Find(ans).Select End Sub -- Don Guillett SalesAid Software "Susana C via OfficeKB.com" <u21183@uwe wrote in message news:6a9b9915c300f@uwe... 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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find Macro
Sub findvalue()
On Error GoTo nono ans = InputBox("Search for?") Columns(1).Find(ans).entirerow.Select Exit Sub nono: MsgBox "not found" Exit Sub -- Don Guillett SalesAid Software "Susana C via OfficeKB.com" <u21183@uwe wrote in message news:6a9bf0d77dff3@uwe... 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 |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find Macro
Sub findvalue()
On Error GoTo nono ans = InputBox("Search for?") Columns(1).Find(ans).entire.row.Select Exit Sub nono: MsgBox "not found" Exit Sub -- Don Guillett SalesAid Software "Susana C via OfficeKB.com" <u21183@uwe wrote in message news:6a9be52398340@uwe... 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 |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to find cell content in sheets and make sheet active | Excel Discussion (Misc queries) | |||
find last record in macro and delete all after | Excel Discussion (Misc queries) | |||
Macro to Find & Replace | Excel Worksheet Functions | |||
Macro to find and delete rows! | Excel Discussion (Misc queries) | |||
Macro - message box if find nothing | Excel Discussion (Misc queries) |