Solved

Problem with Floating Form

Posted on 2014-02-04
7
427 Views
Last Modified: 2014-02-04
Byundt helped me with a Macro that allowed the creation of a floating option box by calling a Form.  In the sample he sent me, it worked perfectly and we closed out the Question.  When I put it into my production file, the form worked but when I put the cursor in any cell, I could not "scroll".  I believe the reason may have something to do with the fact that my production file has a 4 level outline.

Take the file attached, and click on "Select Detail". You will see the options and if you fire any of the buttons/macros, it works perfectly (collapsing and expanding the outline). BUT, you can't scroll.

Help!

B.
Problem-with-floating-Form.xlsm
0
Comment
Question by:Bright01
[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
7 Comments
 
LVL 81

Expert Comment

by:byundt
ID: 39833945
You didn't set the ShowModal property of the userform to False.

After making that change, the code should work.
0
 
LVL 22

Assisted Solution

by:Ejgil Hedegaard
Ejgil Hedegaard earned 100 total points
ID: 39833950
The form has focus and block any other selection.
Change the line in module1 to

Selection.Show vbModeless

Click on the sheet, and you can scroll
0
 
LVL 81

Accepted Solution

by:
byundt earned 300 total points
ID: 39833959
I added a statement selecting the active cell after showing the modeless userform. In so doing, you can scroll right away.
Private Sub Worksheet_Activate()
Dim cel As Range
Set cel = ActiveCell
Selection.Show
cel.Select
End Sub

Open in new window

To change the ShowModal property of a userform:
1.  Click on the userform in the VBA Editor
2.  If the Property pane isn't already displayed, use the View...Properties menu item to display it.
3.  Change the ShowModal property to False, then hit Enter
Problem-with-floating-FormQ28356.xlsm
0
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!

 
LVL 47

Assisted Solution

by:Martin Liss
Martin Liss earned 100 total points
ID: 39833968
You can't scroll a worksheet when you are displaying a userform so your only choice if you want to use the userform is to add the add the Unload me lines in that form's code as shown here.

Option Explicit

Private Sub FunctionalArea_Click()
Expand_FunctionalAreas
Unload Me

End Sub

Private Sub UseCaseDetails_Click()
Expand_DetailsofUseCases
Unload Me

End Sub

Private Sub UseCases_Click()
Expand_UseCases
Unload Me

End Sub

Private Sub ValueProposition_Click()
Expand_ValueProposition
Unload Me

End Sub

Open in new window

Doing that would however IMO make the form redundant since you can do the same thing by clicking the other buttons on the sheet.
0
 
LVL 81

Expert Comment

by:byundt
ID: 39833980
You can't scroll a worksheet when you are displaying a userform
That might be true in other languages, but you can definitely scroll the worksheet in Excel while displaying a modeless userform.
0
 

Author Closing Comment

by:Bright01
ID: 39834023
Wow....thanks guys!  Lots of options here..... I changed the Modal to "False" and added Brundt's code.

Nice "tweak".
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39834030
I stand corrected.
0

Featured Post

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!

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
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…

756 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