Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Modeless UserForm-VBA

Posted on 2005-03-03
9
Medium Priority
?
1,512 Views
Last Modified: 2012-06-27
I've an excel sheet. On changing the content of the cell I would like to display a modeless form which require some user input.

How do I display such a modeless form ( I do not want to use showmodal kind of properties )

TIA
RAJ.
0
Comment
Question by:krisrajz
  • 4
  • 2
6 Comments
 
LVL 50

Accepted Solution

by:
Dave Brett earned 2000 total points
ID: 13447976
Hi RAJ,

If you wanted a modal form whenevr the value in A1 changed then you would use a sheet change event like below. The code assumed you have a userform called UserForm1

right click the sheet tab on the sheet where you want to trigger the form
View - Code
paste the code below

Public Mycell As String

Private Sub Worksheet_Change(ByVal Target As Range)
'leave if the wrong cell is changed ir the new value is not different
    If Target.Address <> "$A$1" Or Target.Value = Mycell Then Exit Sub
    Mycell = Target.Value
    UserForm1.Show vbModeless
End Sub






Cheers

Dave
0
 
LVL 1

Author Comment

by:krisrajz
ID: 13448021
OOPS!. Did not you know that the UserForm does accept vbModeless argument?

or

My versions of VBA IDE does not let me pass on the vbModeless argument

Please checkout.

RAJ.
0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 13448123
RAJ

Modeless forms have been available in Excel VBA from version 2000 and up.

Dave
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:krisrajz
ID: 13456262
Please close the thread as there is no useful replies.

THANX

RAJ.
0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 13456269
RAJ - your question was answered as asked.
0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 13702860
My view is that this question was clearly answered.

Cheers

Dave
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month12 days, 13 hours left to enroll

578 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