Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
don don is offline
external usenet poster
 
Posts: 15
Default Using results from XLDIALOG commands

The following command shows the Find Dialog box but how do I capture
the results of that search.

Application.Dialogs(xlDialogFormulaFind).Show

If I try set stuff = Application.Dialogs(xlDialogFormulaFind).Show
I get an error.

If I try stuff = Application.Dialogs(xlDialogFormulaFind).Show
I get true or false.

I'd like to find the cell that has the data and then capture that
cells attributes, ie address, row, column, etc.

Where can I find examples of using the results of what the dialog box
found. Help shows what attributes to feed the boxes but I can't find
where to capture the results of the search.

Thanks for any help.

Don
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Using results from XLDIALOG commands

I don't think you can use that dialog that way.

Maybe you could build your own find?

Option Explicit
Sub testme01()
Dim WhatToFind As String
Dim FoundCell As Range

WhatToFind = Inputbox(Prompt:="What:")
if whattofind = "" then
exit sub
end if

'you can even limit your range
With ActiveSheet.Range("a1:b99")
'or all the cells
'With ActiveSheet.cells
Set FoundCell = .Cells.Find(What:=WhatToFind, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If FoundCell Is Nothing Then
Msgbox "Not found"
Else
Msgbox Foundcell.address & vblf & _
foundcell.row & vblf & foundcell.column
End If
End With
End Sub

You'll want to specify the parms in the .Find() command, too. Record a macro
when you use the settings you want and you'll see the code you need.

don wrote:

The following command shows the Find Dialog box but how do I capture
the results of that search.

Application.Dialogs(xlDialogFormulaFind).Show

If I try set stuff = Application.Dialogs(xlDialogFormulaFind).Show
I get an error.

If I try stuff = Application.Dialogs(xlDialogFormulaFind).Show
I get true or false.

I'd like to find the cell that has the data and then capture that
cells attributes, ie address, row, column, etc.

Where can I find examples of using the results of what the dialog box
found. Help shows what attributes to feed the boxes but I can't find
where to capture the results of the search.

Thanks for any help.

Don


--

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
xldialog question Gary Keramidas Excel Programming 2 November 30th 06 06:18 AM
Value From xlDialog Brad Excel Programming 1 June 1st 05 12:07 AM
Append code to a xlDialog Kent Smith Excel Programming 1 February 23rd 05 02:24 AM
XLDialog Printer Setup Ron Crapo Excel Programming 2 August 27th 04 05:40 PM
xldialog Philipp Oberleitner[_2_] Excel Programming 5 July 9th 04 06:39 PM


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