Solved

Creating a modal search dialogue in Excel VBA

Posted on 2014-01-14
3
346 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

737 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