#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Cell resizing

Hi,

I have a protected worksheet that looks like an evaluation form with rating
scale, etc. In various areas, there are sections that the user needs to text
in comments. The cell is formatted for wrapping but it does not adjust the
size of the cell in order to accomodate multiple sentences. Is it possible?

Kathleen
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Cell resizing

Do you have under ToolsProtectionProtect SheetAllow users to:

Format rows and Format Cells checkmarked?

Do you have the appropriate Rows set to Autofit?

Note: if any merged cells, these will not autofit to accommodate wrapped text.


Gord Dibben MS Excel MVP


On Wed, 9 Jul 2008 15:29:02 -0700, Kathleen
wrote:

Hi,

I have a protected worksheet that looks like an evaluation form with rating
scale, etc. In various areas, there are sections that the user needs to text
in comments. The cell is formatted for wrapping but it does not adjust the
size of the cell in order to accomodate multiple sentences. Is it possible?

Kathleen


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Cell resizing

Hi Gord,

Thank you for your response. I thought it might be because of the merged
cells. Couldn't get the form to work in Word and it's a a 10 page document
in Excel, so there are many merged cells in order to print and use the
document as well as enter in it online. Back to square one for me.

Kathleen

"Gord Dibben" wrote:

Do you have under ToolsProtectionProtect SheetAllow users to:

Format rows and Format Cells checkmarked?

Do you have the appropriate Rows set to Autofit?

Note: if any merged cells, these will not autofit to accommodate wrapped text.


Gord Dibben MS Excel MVP


On Wed, 9 Jul 2008 15:29:02 -0700, Kathleen
wrote:

Hi,

I have a protected worksheet that looks like an evaluation form with rating
scale, etc. In various areas, there are sections that the user needs to text
in comments. The cell is formatted for wrapping but it does not adjust the
size of the cell in order to accomodate multiple sentences. Is it possible?

Kathleen



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Cell resizing

You can use event code to autofit the merged cells if you choose to use them.

Here is code from Greg Wilson.

Make sure cells are set to wrap text and rows set to autofit.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With
End Sub


Gord

On Mon, 14 Jul 2008 08:41:02 -0700, Kathleen
wrote:

Hi Gord,

Thank you for your response. I thought it might be because of the merged
cells. Couldn't get the form to work in Word and it's a a 10 page document
in Excel, so there are many merged cells in order to print and use the
document as well as enter in it online. Back to square one for me.

Kathleen

"Gord Dibben" wrote:

Do you have under ToolsProtectionProtect SheetAllow users to:

Format rows and Format Cells checkmarked?

Do you have the appropriate Rows set to Autofit?

Note: if any merged cells, these will not autofit to accommodate wrapped text.


Gord Dibben MS Excel MVP


On Wed, 9 Jul 2008 15:29:02 -0700, Kathleen
wrote:

Hi,

I have a protected worksheet that looks like an evaluation form with rating
scale, etc. In various areas, there are sections that the user needs to text
in comments. The cell is formatted for wrapping but it does not adjust the
size of the cell in order to accomodate multiple sentences. Is it possible?

Kathleen




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Cell resizing

I'm sorry to say I'm a total novice with VBA and haven't a clue how to set up
the event code properly. I opened VBA, procedure, and copied/pasted your
language but am not sure which or what needs to be adjusted to fit my
template. I'm going through my course book now to see if it will help me to
understand better. Its a huge relief to know that there is a work around to
make this document function the way we hope. I can't thank you enough for
helping me with this issue!

"Gord Dibben" wrote:

You can use event code to autofit the merged cells if you choose to use them.

Here is code from Greg Wilson.

Make sure cells are set to wrap text and rows set to autofit.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With
End Sub


Gord

On Mon, 14 Jul 2008 08:41:02 -0700, Kathleen
wrote:

Hi Gord,

Thank you for your response. I thought it might be because of the merged
cells. Couldn't get the form to work in Word and it's a a 10 page document
in Excel, so there are many merged cells in order to print and use the
document as well as enter in it online. Back to square one for me.

Kathleen

"Gord Dibben" wrote:

Do you have under ToolsProtectionProtect SheetAllow users to:

Format rows and Format Cells checkmarked?

Do you have the appropriate Rows set to Autofit?

Note: if any merged cells, these will not autofit to accommodate wrapped text.


Gord Dibben MS Excel MVP


On Wed, 9 Jul 2008 15:29:02 -0700, Kathleen
wrote:

Hi,

I have a protected worksheet that looks like an evaluation form with rating
scale, etc. In various areas, there are sections that the user needs to text
in comments. The cell is formatted for wrapping but it does not adjust the
size of the cell in order to accomodate multiple sentences. Is it possible?

Kathleen






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Cell resizing

Greg's code is worksheet event code.

Right-click on the worksheet tab and "View Code".

Copy/paste into that sheet module.

Alt + q to return to the Excel window.

Make sure cells are set for wrap text and rows to autofit.


Gord

On Tue, 15 Jul 2008 08:48:02 -0700, Kathleen
wrote:

I'm sorry to say I'm a total novice with VBA and haven't a clue how to set up
the event code properly. I opened VBA, procedure, and copied/pasted your
language but am not sure which or what needs to be adjusted to fit my
template. I'm going through my course book now to see if it will help me to
understand better. Its a huge relief to know that there is a work around to
make this document function the way we hope. I can't thank you enough for
helping me with this issue!

"Gord Dibben" wrote:

You can use event code to autofit the merged cells if you choose to use them.

Here is code from Greg Wilson.

Make sure cells are set to wrap text and rows set to autofit.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With
End Sub


Gord

On Mon, 14 Jul 2008 08:41:02 -0700, Kathleen
wrote:

Hi Gord,

Thank you for your response. I thought it might be because of the merged
cells. Couldn't get the form to work in Word and it's a a 10 page document
in Excel, so there are many merged cells in order to print and use the
document as well as enter in it online. Back to square one for me.

Kathleen

"Gord Dibben" wrote:

Do you have under ToolsProtectionProtect SheetAllow users to:

Format rows and Format Cells checkmarked?

Do you have the appropriate Rows set to Autofit?

Note: if any merged cells, these will not autofit to accommodate wrapped text.


Gord Dibben MS Excel MVP


On Wed, 9 Jul 2008 15:29:02 -0700, Kathleen
wrote:

Hi,

I have a protected worksheet that looks like an evaluation form with rating
scale, etc. In various areas, there are sections that the user needs to text
in comments. The cell is formatted for wrapping but it does not adjust the
size of the cell in order to accomodate multiple sentences. Is it possible?

Kathleen





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
resizing a picture to fit a single cell HELP erical Excel Discussion (Misc queries) 2 January 4th 07 08:51 AM
cell resizing problems P. Cruser Excel Worksheet Functions 2 September 13th 06 07:18 PM
Resizing cells in a selection without resizing entire sheet Danielle via OfficeKB.com Excel Discussion (Misc queries) 4 August 11th 06 10:06 PM
Resizing a cell gpearson Excel Worksheet Functions 3 January 23rd 06 10:58 PM
auto resize text without resizing cell in excel Ferd Excel Discussion (Misc queries) 1 May 25th 05 12:22 AM


All times are GMT +1. The time now is 12:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"