Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 422
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying cell values to a external file in VBA DJ MC Excel Discussion (Misc queries) 6 September 29th 06 09:07 AM
macro unouwanme Excel Discussion (Misc queries) 9 August 31st 06 09:38 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Positioning Numeric Values Resulting from 6 Column Array Formula Sam via OfficeKB.com Excel Worksheet Functions 2 January 5th 06 02:03 AM
Problem with Page Numbering Aurora Excel Discussion (Misc queries) 0 November 21st 05 02:10 PM


All times are GMT +1. The time now is 01:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"