Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Controlling column widths in interactive web page output
Hi,
Apology: Already posted in excel.worksheet.functions a few days ago, but think this may be more appropriate location. Apologies if you're reading it twice. I'm having an issue with column widths when generating an interactive HTML page from an Excel sheet. Basically, although the columns are set up with the proper widths in Excel (and these widths are respected when generating static HTML) they appear narrower when the interactive web version is displayed. I can't find anything about this problem anywhere in the help, the web, or on newsgroups, but it seems to me as though the proportions of the columns are staying the same - it's that the web view (because of the big useless white border - any suggestions on that welcome) is smaller so the columns become narrower. I need my columns to stay the width they're set up as in Excel. Is there any way to explicitly set pixel values for column width for exporting to interactive HTML? Or any other way around the problem? Thanks, Chris |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Controlling column widths in interactive web page output
As a last resort, with no other options you might try something like the
following. I wrote it to autofit my sheet PLUS to add 3 additional spaces at the end to have it look a bit more unbuntched. Sub AutoFitPlus3Spaces() Dim LCol As Long Dim CurrCol As Range Dim MyCol As Integer Dim Dcol As String Dim i As Integer ActiveCell.SpecialCells(xlLastCell).Select LCol = Selection.Column MyCol = LCol + 64 Dcol = Chr(MyCol) Application.Range("A:" & Dcol).Columns.AutoFit For i = 1 To LCol Set myrng = Range(Cells(1, i), Cells(Rows.Count, i)) If Application.WorksheetFunction.CountA(myrng) 0 Then Columns(i).ColumnWidth = Int(Columns(i).ColumnWidth) + 3 'change to suit End If Next i End Sub HTH, Jim May "Chris Collingridge" wrote in message : Hi, Apology: Already posted in excel.worksheet.functions a few days ago, but think this may be more appropriate location. Apologies if you're reading it twice. I'm having an issue with column widths when generating an interactive HTML page from an Excel sheet. Basically, although the columns are set up with the proper widths in Excel (and these widths are respected when generating static HTML) they appear narrower when the interactive web version is displayed. I can't find anything about this problem anywhere in the help, the web, or on newsgroups, but it seems to me as though the proportions of the columns are staying the same - it's that the web view (because of the big useless white border - any suggestions on that welcome) is smaller so the columns become narrower. I need my columns to stay the width they're set up as in Excel. Is there any way to explicitly set pixel values for column width for exporting to interactive HTML? Or any other way around the problem? Thanks, Chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying cell values to a external file in VBA | Excel Discussion (Misc queries) | |||
macro | Excel Discussion (Misc queries) | |||
Need to Improve Code Copying/Pasting Between Workbooks | Excel Discussion (Misc queries) | |||
Positioning Numeric Values Resulting from 6 Column Array Formula | Excel Worksheet Functions | |||
Problem with Page Numbering | Excel Discussion (Misc queries) |