Wrap not working

G

Guest

Hi,

I am placing information to a worksheet via vba code and the wrap is not
working. How do I correct this? Here is my code:

Sub SaveTenantName(Choice)

With MainPagepg

'save Tenants Name
With .Cells(Choice, 6)
.NumberFormat = "General"
.HorizontalAlignment = xlLeft
.WrapText = True
.Value = frmStoreData.txtTenantName.Value
End With

End With

End Sub
 
G

Guest

I realize now the wrap is there but the row height is not adjusting to show
the text.
 
G

Guest

Hi,

I've added row autofit but it still is not sizing. What am I doing wrong?

Sub SaveTenantName(Choice)

With MainPagepg

'save Tenants Name
With .Cells(Choice, 6)
.NumberFormat = "General"
.HorizontalAlignment = xlLeft
.WrapText = True
.Value = frmStoreData.txtTenantName.Value
End With
.Rows(Choice & ":" & Choice).EntireRow.AutoFit
End With

End Sub
 
G

Guest

Try this change
from:
With MainPagepg
to:
With sheets(MainPagepg)

or

With sheets("MainPagepg")
 
G

Guest

Hi,

Thank you for your suggestions. I'm using the sheets code name, though.
They did not work.
 

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

Top