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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cell Height & Width

Status
Not open for further replies.

Loomah

Technical User
Mar 4, 2002
1,911
IE
I'm looking to have one sheet in a workbook with nothing (no scroll bars, row or column heads etc.) showing except cell A1. But I want to resize A1 to use the full screen allowinf for different sized monitors and different resolutions etc.

Does anybody know how/if this can be done?? I could set the size statically but this may lead to bit missing from the screen.

Thanks
Loomah
 
Hi,

By the way, max Row Height is 409

You could do it this way...
Code:
Sub ResizeA1()
    Dim iRowHeight As Integer
    Const WIDTH_CONV = 6.0375
    DisplaysOFF
    With ActiveSheet.Cells(1, 1)
        .Columns.ColumnWidth = Int(ActiveWindow.Width / WIDTH_CONV)
        iRowHeight = ActiveWindow.Height
        If iRowHeight > 409 Then iRowHeight = 409
        .Rows.RowHeight = iRowHeight
    End With
End Sub
Sub DisplaysOFF()
    With ActiveWindow
        .DisplayHeadings = False
        .DisplayHorizontalScrollBar = False
        .DisplayVerticalScrollBar = False
        .DisplayWorkbookTabs = False
    End With
    With Application
        .DisplayFormulaBar = False
        .DisplayStatusBar = False
    End With
End Sub
hope this helps :) Skip,
metzgsk@voughtaircraft.com
 
Skip
Many Thanks
This almost works but the cell doesn't become quite wide enough so columns B & C are still visible (this won't matter long term as they'll be hidden).

To get me on my way what is "WIDTH_CONV = 6.0375"? Is it an acknowledged constant? I mean, why divide the active window by 6.0375? I assume conversion between measurements, twips and the like?

Thanks again
Loomah
 
Width is in pixels. ColumnWidth is width of one character in the Normal style. With proportional fonts it varies. Column Width cannot be set in pixels. Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top