Solved

Excel VBA - Show userform at the right top when activated

Posted on 2011-09-06
16
397 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
Comment Utility
put this

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

gowflow
0
 
LVL 29

Accepted Solution

by:
gowflow earned 500 total points
Comment Utility
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
Comment Utility
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
 
LVL 12

Expert Comment

by:sdwalker
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Me neither. That's nuts! Maybe he doesn't know what he did.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 29

Expert Comment

by:gowflow
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I still don't get it !!! but it is beyond the scope of my intelligence !
gowflow
0
 
LVL 12

Expert Comment

by:sdwalker
Comment Utility
Question was correctly answered
0
 

Author Comment

by:ekaplan323
Comment Utility
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
Comment Utility
yes it didn't !
gowflow
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now