Word wrap and cell size

  • Thread starter Thread starter Stanley Braverman
  • Start date Start date
S

Stanley Braverman

I have 2 columns that I need to automatically increase the size of the row
that would be using a word wrap. I might have several hundred rows that
does not need to be increased in size but several rows would need it because
of word wrap. Can anyone suggest a macro for this.

Thanks
 
Simple option you could adapt....

Sheets("Sheet1").Rows("1:" & .Cells(.Rows.Count, "A").End(xlUp).Row).AutoFit
 
Getting Invalid or unqualified reference error

Sub wordwrap()

Sheets("Sheet1").rows("1:" & .Cells(.rows.Count, "A").End(xlUp).Row).AutoFit

End Sub
 
Stanley

How would you designate which rows would need word wrap?

BTW..........you cannot increae row size in just two columns.

Row size is a property of the entire row.


Gord Dibben MS Excel MVP
 
Apologies I change the construct after copying the code, correction here

Sub wordwrap()
With Sheets("Sheet1")
.Rows("1:" & .Cells(.Rows.Count, "A").End(xlUp).Row).AutoFit
End With
End Sub

Note: The 1 at the left indicates the start row, the "A" indicates the
column letter used determine the depth of rows used. Change as required.

--

Regards,
Nigel
(e-mail address removed)
 
Back
Top