Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Neat Rowan; Is there a way to "nudge-up" the spacing
a few more characters "above the standard "autofit amt? If so, how? TIA, "Rowan Drummond" wrote in message ... Maybe with a macro. Assuming your headers are in row 1: Sub header() Dim eCol As Integer Dim i As Integer Dim head As String eCol = Cells(1, Columns.Count).End(xlToLeft).Column For i = 1 To eCol With Cells(1, i) head = .Value .ClearContents .EntireColumn.AutoFit .WrapText = True .Value = head End With Next i End Sub Hope this helps Rowan MarkN wrote: Hello, I get about forty columns of data dumped into an Excel sheet every month. The column headers at the top of the columns are usually considerably wider than the data in the columns. I want to wrap the header text in each column so that it is as wide as the widest entry in the rest of that column. Each column width is diferent. If anybody knows a quick method of doing this, it would save me a lot of time. |
#2
![]() |
|||
|
|||
![]()
You can look and just adjust.
With ActiveCell.EntireRow MsgBox .RowHeight & " -- before" .RowHeight = .RowHeight - 1 MsgBox .RowHeight & " -- before" End With But sometimes, it's a mistake to do. You could be chopping the top or bottom line of characters. Jim May wrote: Neat Rowan; Is there a way to "nudge-up" the spacing a few more characters "above the standard "autofit amt? If so, how? TIA, "Rowan Drummond" wrote in message ... Maybe with a macro. Assuming your headers are in row 1: Sub header() Dim eCol As Integer Dim i As Integer Dim head As String eCol = Cells(1, Columns.Count).End(xlToLeft).Column For i = 1 To eCol With Cells(1, i) head = .Value .ClearContents .EntireColumn.AutoFit .WrapText = True .Value = head End With Next i End Sub Hope this helps Rowan MarkN wrote: Hello, I get about forty columns of data dumped into an Excel sheet every month. The column headers at the top of the columns are usually considerably wider than the data in the columns. I want to wrap the header text in each column so that it is as wide as the widest entry in the rest of that column. Each column width is diferent. If anybody knows a quick method of doing this, it would save me a lot of time. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count Intervals of Filtered TEXT values in Column and Return Count across a Row | Excel Worksheet Functions | |||
Arithmetical Mode of Criteria in Multiple Non-Adjacent columns | Excel Worksheet Functions | |||
row height not accounting for wrap text | Excel Discussion (Misc queries) | |||
Wrap text limits in Excel 2003 cell formatting | Excel Discussion (Misc queries) | |||
Putting text in a column based on variable text from another colum | Excel Discussion (Misc queries) |