?
Solved

Excel VBA - Show userform at the right top when activated

Posted on 2011-09-06
16
Medium Priority
?
417 Views
Last Modified: 2012-05-12
I have a form that pops up with a macro or upon initialzation.using the code

frmIntro.Show vbModeless

How can I make this come up in the upper right hand corner of the spreadsheet window?

Thanks, Eric
0
Comment
Question by:ekaplan323
[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
  • 4
  • 3
16 Comments
 
LVL 31

Expert Comment

by:gowflow
ID: 36489440
put this

frmIntro.Show vbModeless
frmIntro.left = 0
frmIntro.top=0

gowflow
0
 
LVL 31

Accepted Solution

by:
gowflow earned 2000 total points
ID: 36489618
Ooops you said upper right hand corner !!! Sorry
What I discribed before was the upper left corner.

Here is the Upper right Corner
frmIntro.Show vbModeless
frmIntro.Left = ActiveWindow.Width - frmIntro.Width - 15
frmIntro.top=0

gowflow
0
 

Author Comment

by:ekaplan323
ID: 36490229
Gowflow,

Thanks, it works but you could just explain the code on line :
 frmIntro.Left = ActiveWindow.Width - frmIntro.Width - 15
So that I can understand this for future applications

Thanks, Eric

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 12

Expert Comment

by:sdwalker
ID: 36490853
He is seeing how wide the Excel window is and then subtracting the width of the form window.  This would put your form at the extreme right edge of the window.  He is then subtracting 15 more pixels so that it resides within the boundary of the Excel application.

At least that's how I see it.

sdwalker
0
 

Author Comment

by:ekaplan323
ID: 36491629
I've requested that this question be closed as follows:

Accepted answer: 0 points for ekaplan323's comment http:/Q_27293237.html#36490229

for the following reason:

Simple solution that works
0
 
LVL 31

Expert Comment

by:gowflow
ID: 36491630
I gave you the solution and why on earth you accept your comment as a solution with zero points ??? Not that I am after points but I strictly do not get it !!!
gowflow
0
 
LVL 12

Expert Comment

by:sdwalker
ID: 36491640
Me neither. That's nuts! Maybe he doesn't know what he did.
0
 
LVL 31

Expert Comment

by:gowflow
ID: 36491656
Well I objected to his closure It's the first time ever since I am member in EE !!!
:(
gowflow
0
 
LVL 31

Expert Comment

by:gowflow
ID: 36491700
ekaplan323
Sorry for my quick comment but I guess you closed the question wrongly. If yes and it is the case you need to click on the answer that you feel is the correct answer for you. If still you choose for your answer to be please explain as we do not understand. If you feel multiple answers get to be chosen then you click on each and you attribute points to each
gowflow
0
 

Author Comment

by:ekaplan323
ID: 36496500
I've requested that this question be closed as follows:

Accepted answer: 0 points for ekaplan323's comment http:/Q_27293237.html#36490229
Assisted answer: 500 points for gowflow's comment http:/Q_27293237.html#36489440

for the following reason:

Great solution simple
0
 
LVL 31

Expert Comment

by:gowflow
ID: 36496266
I still don't get it !!! but it is beyond the scope of my intelligence !
gowflow
0
 
LVL 12

Expert Comment

by:sdwalker
ID: 36496499
Question was correctly answered
0
 

Author Comment

by:ekaplan323
ID: 36496606
Sorry for the misunderstaning, must have clicked the wrong button and I thought I corrected it by awarding the points to goflow.  I guess that didn't quite do it huh
0
 
LVL 31

Expert Comment

by:gowflow
ID: 36496799
yes it didn't !
gowflow
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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

770 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