Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Autofit column does not work correctly

$
0
0

The code below is working but it does not show all text? The sheet has a header and footer and column A is the width of the entire page.  My goal is to get the value from my userform into the sheet for printing, the text could be a sentence or multiple pages. The print button on the user form calls the sub. below is the code and have tried similar in the sheet code.

Sheets("Sheet2").Cells(3, 1).Value = TxtBackgroundContext.Value
   With Worksheets("Sheet2").Range("a3")
     Worksheets("Sheet2").Range("a3").WrapText = True
     Worksheets("Sheet2").Range("a3").HorizontalAlignment = xlLeft
     Worksheets("Sheet2").Range("a3").VerticalAlignment = xlTop
     Worksheets("Sheet2").Range("a3").Columns.AutoFit


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>