Solved

Creating a modal search dialogue in Excel VBA

Posted on 2014-01-14
3
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Expert Comment

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

Accepted Solution

by:
Rob 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

690 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