Solved

Creating a modal search dialogue in Excel VBA

Posted on 2014-01-14
3
316 Views
Last Modified: 2014-01-16
I want to retrieve all the cells on a worksheet that are formatted the same way.  I have two methods of opening the formatting search dialogue, but neither method is modal:

1: Application.CommandBars.FindControl(ID:=1849).Execute 
2: Application.CommandBars("Edit").Controls("Find...").Execute 

Open in new window


The problem with a non-modal search dialogue is that my code does not wait for me to close it before continuing with code execution.  As an alternate method, if there were a worksheet or workbook event that were savvy enough to track and run after I closed the formatting dialogue, then my followon code could take over from that point.  Any notion of how to do this?  Below is a screenshot of the formatting dialogue.  Thanks, ~Peter Ferber

Search on highlighted cells, not text
0
Comment
Question by:PeterFrb
3 Comments
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39782397
Display a msgbox after showing the dialog.
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
ID: 39784304
The Event,

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
   
End Sub

will capture when the selection is changed in the worksheet.
0
 

Author Closing Comment

by:PeterFrb
ID: 39787424
Oooh, sweet.  Thanks much!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now