Solved

Excel VBA - Show userform at the right top when activated

Posted on 2011-09-06
16
401 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
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

809 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