ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell size format (https://www.excelbanter.com/excel-programming/295855-cell-size-format.html)

Josh[_9_]

Cell size format
 
I need to copy a cell from a sheet set up to input information(Input) to
another sheet that is set up as a letter template(Template) The problem
I am having is, sometimes the cell contains about a paragraph of
information, other times it could only contain a few words.

Is it possible to automatically change the size of the cell on the
Template sheet to match the size of the cell on the Input sheet.

Also, since it will be printed, is it possible to wrap the cell to the
next row when it reaches the set print area(or a designated cell)?

Thanks,
Josh

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Bill Renaud[_2_]

Cell size format
 
Declare and set object references to both the cell on the Input worksheet
and the Template worksheet, then try the following code:

With rngTemplateCell
.Value = rngInputCell.Value 'Copy the value to the new cell.
.WrapText = rngInputCell.WrapText
.ColumnWidth = rngInputCell.ColumnWidth

'If the cell formats (font sizes) are the same, use this:
.RowHeight = rngInputCell.RowHeight
'Otherwise, use the following to autofit the row height.
.EntireRow.AutoFit
End With
--
Regards,
Bill


"Josh" wrote in message
...
I need to copy a cell from a sheet set up to input information(Input) to
another sheet that is set up as a letter template(Template) The problem
I am having is, sometimes the cell contains about a paragraph of
information, other times it could only contain a few words.

Is it possible to automatically change the size of the cell on the
Template sheet to match the size of the cell on the Input sheet.

Also, since it will be printed, is it possible to wrap the cell to the
next row when it reaches the set print area(or a designated cell)?

Thanks,
Josh

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com