Cell size format

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top