UserForm StartUpPosition [英] UserForm StartUpPosition

查看:302
本文介绍了UserForm StartUpPosition的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在excel中弹出了一个漂亮的日历,并通过以下方式测试了UserForm的位置:



.Top = Application.Top + 125
.Left = Application.Left + 125



这是非常好的,但我真正想要的是在活动单元格旁边弹出窗体。



我以下尝试的不工作,我不知道为什么。我想要窗体的左上角触摸活动单元格的右上角,但是表单最后覆盖了活动单元格



。 Top = ActiveCell.Top
.Left = ActiveCell.Left + ActiveCell.Width



任何建议? p>

解决方案

根据您的预期,这适用于我:

  .Top = ActiveCell.Top + ActiveCell.Height / 2 + .Height 
.Left = ActiveCell.Left + ActiveCell.Width * 1.5


I have made a nice calendar pop up in excel and tested the UserForm position with:

.Top = Application.Top + 125 .Left = Application.Left + 125

This works great however what I truly would like is to have the form pop up right next to the active cell.

What I have tried below is not working and I am not sure why. I want the top left corner of the form to touch the top right of the active cell, however the form ends up covering the active cell

.Top = ActiveCell.Top .Left = ActiveCell.Left + ActiveCell.Width

Any Suggestions?

解决方案

This is working for me as you expect:

    .Top = ActiveCell.Top + ActiveCell.Height / 2 + .Height
    .Left = ActiveCell.Left + ActiveCell.Width * 1.5

这篇关于UserForm StartUpPosition的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆