Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Why wont 'autofit' and 'wrap text' remain in tact?

I am trying to reference a cell in another worksheet that is formatted to
'autofit' and 'wrap text', but when the information of the original cell
translates to the destination cell, it loses its 'autofit' and 'wrap text'
format. Someone suggested the following, but I am still not having any luck
unless I am applying the code incorrectly.

Right-click the sheet tab, select View Code, enter this:
Private Sub Worksheet_Change(ByVal Target As Range)
Rows(Target.Row).AutoFit
End Sub

HELP!!!

Bermi Girl
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Why wont 'autofit' and 'wrap text' remain in tact?

How does the value get "translated" to that other sheet?

If you're using a formula, then if you knew where the cell was in that receiving
worksheet, you may be able to tie it that way.

Or maybe you could tie into that worksheet's calculate event.

Or maybe you could just autofit all the rows each time you activate that
sheet????



Bermi Girl wrote:

I am trying to reference a cell in another worksheet that is formatted to
'autofit' and 'wrap text', but when the information of the original cell
translates to the destination cell, it loses its 'autofit' and 'wrap text'
format. Someone suggested the following, but I am still not having any luck
unless I am applying the code incorrectly.

Right-click the sheet tab, select View Code, enter this:
Private Sub Worksheet_Change(ByVal Target As Range)
Rows(Target.Row).AutoFit
End Sub

HELP!!!

Bermi Girl


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Why wont 'autofit' and 'wrap text' remain in tact?

Hi Dave,

I am making a little bit of progress. The following code was suggested,
which successfully formats the receiving cell with autofit and wrap text, but
it only takes effect when I type the information in the original cell, close
out Excel and re-open Excel. I need something that takes effect immediately
and does not require me to close out the application to work.

Private Sub Worksheet_Activate()
Rows.AutoFit
End Sub
--
Bermi Girl


"Dave Peterson" wrote:

How does the value get "translated" to that other sheet?

If you're using a formula, then if you knew where the cell was in that receiving
worksheet, you may be able to tie it that way.

Or maybe you could tie into that worksheet's calculate event.

Or maybe you could just autofit all the rows each time you activate that
sheet????



Bermi Girl wrote:

I am trying to reference a cell in another worksheet that is formatted to
'autofit' and 'wrap text', but when the information of the original cell
translates to the destination cell, it loses its 'autofit' and 'wrap text'
format. Someone suggested the following, but I am still not having any luck
unless I am applying the code incorrectly.

Right-click the sheet tab, select View Code, enter this:
Private Sub Worksheet_Change(ByVal Target As Range)
Rows(Target.Row).AutoFit
End Sub

HELP!!!

Bermi Girl


--

Dave Peterson
.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Why wont 'autofit' and 'wrap text' remain in tact?

The worksheet_activate should fire whenever you change to that sheet.

In fact, this event won't fire when you open excel (unless you change to this
sheet in some open procedure).

So either you have a macro that turns off events and forgets to turn it back on
or some other problem.

Try this next time the rows don't autofit when you change to this sheet.

Hit alt-f8 to get to the VBE
hit ctrl-g to see the immediate window
type this and hit enter:
application.enableevents = true

Then back to excel, change to a different sheet, then change back.

In fact, to double check that the procedure is firing, add a (temporary) msgbox:

Private Sub Worksheet_Activate()
msgbox "It's firing!"
me.Rows.AutoFit
End Sub

====
And you did put this into the worksheet module that should be autofit, right????

Bermi Girl wrote:

Hi Dave,

I am making a little bit of progress. The following code was suggested,
which successfully formats the receiving cell with autofit and wrap text, but
it only takes effect when I type the information in the original cell, close
out Excel and re-open Excel. I need something that takes effect immediately
and does not require me to close out the application to work.

Private Sub Worksheet_Activate()
Rows.AutoFit
End Sub
--
Bermi Girl

"Dave Peterson" wrote:

How does the value get "translated" to that other sheet?

If you're using a formula, then if you knew where the cell was in that receiving
worksheet, you may be able to tie it that way.

Or maybe you could tie into that worksheet's calculate event.

Or maybe you could just autofit all the rows each time you activate that
sheet????



Bermi Girl wrote:

I am trying to reference a cell in another worksheet that is formatted to
'autofit' and 'wrap text', but when the information of the original cell
translates to the destination cell, it loses its 'autofit' and 'wrap text'
format. Someone suggested the following, but I am still not having any luck
unless I am applying the code incorrectly.

Right-click the sheet tab, select View Code, enter this:
Private Sub Worksheet_Change(ByVal Target As Range)
Rows(Target.Row).AutoFit
End Sub

HELP!!!

Bermi Girl


--

Dave Peterson
.


--

Dave Peterson
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
text wont wrap Rambo Excel Discussion (Misc queries) 2 March 6th 08 10:25 PM
Linked cells and text wrap / autofit function Ken H Excel Worksheet Functions 1 May 31st 07 08:03 PM
Wrap text and row autofit not working in Excel dclink9 Excel Discussion (Misc queries) 1 June 23rd 06 03:11 AM
when I wrap text in excel it disappears? autofit does not work Gareth Excel Worksheet Functions 2 December 7th 05 06:07 PM
How do I "Wrap Text" & "Autofit" within Merged Cells in Excel? 6-shooter Excel Worksheet Functions 3 October 31st 04 12:14 AM


All times are GMT +1. The time now is 11: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"