Solved

Creating a modal search dialogue in Excel VBA

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

Expert Comment

by:MacroShadow
Comment Utility
Display a msgbox after showing the dialog.
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
Comment Utility
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
Comment Utility
Oooh, sweet.  Thanks much!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

772 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

14 Experts available now in Live!

Get 1:1 Help Now