Solved

Excel VBA - Show userform at the right top when activated

Posted on 2011-09-06
16
405 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 29

Expert Comment

by:gowflow
ID: 36489440
put this

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

gowflow
0
 
LVL 29

Accepted Solution

by:
gowflow earned 500 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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 29

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 29

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 29

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 29

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 29

Expert Comment

by:gowflow
ID: 36496799
yes it didn't !
gowflow
0

Featured Post

Independent Software Vendors: 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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

730 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