Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"top" dimension of active sheets in Excel

Status
Not open for further replies.

rvaughn

Technical User
Aug 9, 2010
1
US
In Excel 2003, I am attempting to automatically place a VBA form on a worksheet at a constant position relative to the worksheet, not at a constant position on the screen. I want the code to identify the worksheet's "top" position, then use the information to define the coordinates for the form.

I tried "Activesheet", "ActiveWindow", "VisibleRange", etc, but haven't found the right combination. Also, for some reason, "ActiveSheet.Top" always returns a value of -17.

I am sure that there is a straightforward solution for this (a simple command or statement?) but I haven't found it yet.
 



hi,

Try Activesheet.Cells.Top

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 



I don't believe that this will "solve" you dilema, however.

The UserForm is not a property of the Worksheet.

Activewindow.Top returns the position of the "distance, in points, from the top edge of the screen to the top edge of the main Microsoft Excel window."

If you want to UserForm to "scroll" with the sheet, you'll need to do some fancy coding.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top