Macro to Resize Cells for Word Wrap

Hi folks,

Would like to write a macro that checks the cells in column D, and resizes
those that have wrap-around text that is not showing.

Many thanks...   ./Randy

0
ran (54)
7/16/2004 6:42:13 PM
excel 39879 articles. 2 followers. Follow

7 Replies
13241 Views

Similar Articles

[PageSpeed] 31

Randy,

What do you want to change to resize?  Column width?  Height?  For height,
you can set all the rows to autofit (Format - Rows - Autofit).  Rows that
have been manually height-adjusted go out of autofit mode.  You can set all
of column D to wrap by selecting it, then Format - Cells - Alignment - Word
wrap.  Maybe this will take care of this situation.

-- 
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Randy Numbers" <ran@hotmail.com> wrote in message
news:IjVJc.56469$H92.24345@fe03.usenetserver.com...
> Hi folks,
>
> Would like to write a macro that checks the cells in column D, and resizes
> those that have wrap-around text that is not showing.
>
> Many thanks...   ./Randy
>


0
nowhere1083 (630)
7/16/2004 6:57:46 PM
Earl,

Thanks for your reply -- sory foir not being more clear: my speradsheet has
certain cells for free-form text. Sometimes they enter more text than gets
displayed; other times there is much empty space.  I have protected the
sheets so manual resizing is not possible for the user. I would like to
create a macro that:
1. Unlocks the sheet
2. Resizes the cells to show full text (adjusting the height)
3. Relock the sheet

I realize the lock/unlock exposes the password -- and that's ok.

Thanks!   .../Rn

0
ran (54)
7/16/2004 8:04:17 PM
ActiveSheet.Unprotect Password:="MyPass"
Cells.Rows.AutoFit
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True,
Password:="MyPass"

-- 
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Randy Numbers" <ran@hotmail.com> wrote in message
news:QwWJc.7916$gu.6610@fe50.usenetserver.com...
> Earl,
>
> Thanks for your reply -- sory foir not being more clear: my speradsheet
has
> certain cells for free-form text. Sometimes they enter more text than gets
> displayed; other times there is much empty space.  I have protected the
> sheets so manual resizing is not possible for the user. I would like to
> create a macro that:
> 1. Unlocks the sheet
> 2. Resizes the cells to show full text (adjusting the height)
> 3. Relock the sheet
>
> I realize the lock/unlock exposes the password -- and that's ok.
>
> Thanks!   .../Rn
>


0
nowhere1083 (630)
7/17/2004 3:02:29 AM
You may wish to experiment with a relatively long text string (2000
characters or so ; using font size 8) entered into a worksheet cell of
50-wide.

In this case, Autofit does not help ; Spelling checker does not help ;
Find and Replace do not help neither.

I'm sure that MS can do something about it very easily. 

Only dodgers would quip : why would one deal with long text in Excel ?

Similar queries have emerged time and again in this neighbourhood ;
search the archive. Is life meant to be easy, or what ?

Regards.
0
tkt_tang (117)
7/17/2004 3:36:38 AM
Earl,

This does the trick -- although I noticed it won't work on merged cells
(neither will the command from the menu...)  . Thanks    RN

BTW, can you recommend a good book that VBA -- I bought John Green's  Excel
2000 VBA Programmers Guide and it is either too advnaced or not laid out
well for a me. 

0
ran (54)
7/19/2004 8:12:23 PM
For excel books, Debra Dalgleish has a big list of books at:
http://www.contextures.com/xlbooks.html

John Walkenbach's is a nice one to start with.  I think that John Green 
(and others) is nice, too.  See if you can find them in your local bookstore and
you can choose what
one you like best.

Randy Numbers wrote:
> 
> Earl,
> 
> This does the trick -- although I noticed it won't work on merged cells
> (neither will the command from the menu...)  . Thanks    RN
> 
> BTW, can you recommend a good book that VBA -- I bought John Green's  Excel
> 2000 VBA Programmers Guide and it is either too advnaced or not laid out
> well for a me.

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
7/19/2004 9:33:55 PM
Randy,

Autofit doesn't seem to work manually.  Yet ANOTHER reason to avoid merged
cells, it would seem.  The list has gotten so long I can't remember them
all.  Kind of like the foolish things Cox Communications has done in our
area over the years.  Can't remember them all.

-- 
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Randy Numbers" <ran@hotmail.com> wrote in message
news:HWVKc.100556$JP.33277@fe24.usenetserver.com...
> Earl,
>
> This does the trick -- although I noticed it won't work on merged cells
> (neither will the command from the menu...)  . Thanks    RN
>
> BTW, can you recommend a good book that VBA -- I bought John Green's
Excel
> 2000 VBA Programmers Guide and it is either too advnaced or not laid out
> well for a me.
>


0
nowhere1083 (630)
7/20/2004 3:07:49 AM
Reply:

Similar Artilces:

Macro warning with no macros
I have a workbook that when I try to open it I get the warning tellin me it contains macros and asking whether I want to Enable or Disabl them. I put no macros, no VB scripts, nothing at all in the workboo other than standard Excel formulas and some charts. I developed it i Excel 2002, SP-2, but have moved it back and forth between tw computers, the other which has Excel 97. Regardless of whether Enable or Disable or change the security settings so as not to get th warning, once the workbook is open even if I go t Tools-Macro-Macros... it lists no macros. How can I find out what's cau...

Word Quits when I close document window
I'm running Office:mac X on OS 10.1.5. When I close a window in word, it usually quits with an error message that says it quit unexpectedly and that other applications and the system are not affected. This also happened when I was running Word for Mac '98 on Classic 9.2.2, but not as consistently. Does anyone know what is going on and how to fix it? In article <0aef01c3789d$3d5f4c00$a001280a@phx.gbl>, "Liz" <S0journer@aol.com> wrote: > I'm running Office:mac X on OS 10.1.5. When I close a > window in word, it usually quits with an error message th...

Why do legacy checkboxes freeze text fields in Word 2007?
If you use "Legacy Controls" checkboxes in Word 2007 and you have plain text or rich text fields, when you protect the document it will freeze you out of text fields after you select a checkbox. It only seems to do this with more than four or five check boxes and more than four or five text boxes. Help, anyone? Legacy fields require the document to be protected. Word 2007 content controls require it to be unprotected, thus the two are incompatible in the same document. -- <>>< ><<> ><<> <>>< ><<> <>...

Macro
Can anybody tell me how to kick off a macro automatically as file is opened? Regards ...

Macro
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: intel Hi, I'm thinking of buying Mac: Office 2008, but before I do I want to check that I will be able to download Scritpsmart collection of templates without any glitches: <http://www.bbc.co.uk/writersroom/scriptsmart/faq.shtml> Does anyone know if I can do this? Regards, SP. In article <ee98ff5.-1@webcrossing.caR9absDaxw>, StregaItalia@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.4 (Tiger) > Processor: intel > > Hi, > > I'm thinking of buying Mac: Of...

Run macro automatically.
How do I make a macro run automatically when a worksheet it is attached to is loaded? right click on the sheet tab>view code>left window worksheet>right window activate -- Don Guillett SalesAid Software donaldb@281.com "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com... > How do I make a macro run automatically when a worksheet it is attached to is > loaded? I am unable to find "activate " when I right click on worksheet. ( i assume that you are referring to the windo...

Help with macro/and or formula?
Perhaps this is a silly question, but i just can't figure out how t format this worksheet. The problem is that a lot of the cells hav numbers in them with negative signs in the back instead of in the fron (ie. 23-) and i was wondering if anyone knew of a macro/formula i coul use to quickly fix this problem for all the cells. I would b extremely grateful. Thanks -- brefed1 ----------------------------------------------------------------------- brefed15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3557 View this thread: http://www.excelforum.com/showthre...

Attached Toolbars Macros
Excel 2003 I have a custom tool bar, this tool bar has several items, each item is pointing to a VBA code. This tool bar is attached to the worksheet. I've copied this spreadsheet to several computers. After I copied the spreadsheet I decided to rename the spreadsheet, after I renamed the spreadsheet the Toolbar Item's macros were still pointing to the old name, I reasigned each tool bar item to the current spreadsheet, saved the spreadsheet and everything was working on my computer, but when I re-copied the new spreadsheet to other computers and I clicked on the Toolbar Item...

I keep having to force quit MS Word It also Freezes screen often
Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I keep having to force quit MS Word. It won't quit when I hit quit. It also seems to Freeze the screen often and I have to restart. Help? Without having so much as an indication what version of Office you're using it's impossible to suggest anything other than the fundamentals; 1- Make sure your version of Office is fully updated, 2- Make sure OS X is fully updated, 3- Run Disk Utility - Repair Disk Permissions, 4- Restart your Mac. If you continue to have a problem reply here with version specific in...

VBA Command to Look at cell in an If statement
I need to create a macro in VBA that will look at a specific cell (which contains the result of a lookup formula) in an If statement. Basically it would look at a certian cell, and If that cell had the word "YES", then it would execute a seprate macro. If not, just continue on it merry way. I have tried the following and several variations: Sheets("Print Area").Select Range("BO8:BO8").Select If BO8 = YES Then Call PrintBatch What the program has to do is look at the last entry made in a specific column (hence the use of the Lookup formula in the cell) and...

Copy picture from word 2003 to word 2007
When I copy a document with a picture from 2003 to 2007 the picture ends up with what looks like a bunch of lines - horizontal. Any way to get rid of this? Your best bet would be to right click the picture in your 2003 document and save the picture to your computer. After this is completed, open Word 2007 and click insert picture. Now browse your computer and find that picture you saved. I'm surprised this happened, but I'm guessing its a compatibility issue between 2003 and 2007. "Daisy" wrote: > When I copy a document with a picture from 2003 to 2007...

Protected sheets and running macros
i have a sheet with a macro ran by a normal button at the top. Howeve when i protect the worksheet where ever i click on the sheet the macr executes. Can any one offer any advice on how to stop this? Thanks Robert -- Message posted from http://www.ExcelForum.com hi, i am not able to reproduce the problem, hence i may not be able t provide a panacea for that issue. here is what i suggest. i have a sheet that has a macro that is run when a control toolbo button (that is, not a form button) is clicked. this sheet is protected based on the user logged in. what i have don is to protect t...

Where are the collums in Mircosoft Word?
PLEASE ANSWER A.S.A.P.!!! Assuming that you are referring to newspaper columns and that you are using Word 2007, look at the Page Layout tab. You'll find a Columns command in the Page Setup group. -- Stefan Blom Microsoft Word MVP "Kaitlyn Moreland" <Kaitlyn Moreland@discussions.microsoft.com> wrote in message news:1D282483-D7F6-440C-AEDA-132789AED1BA@microsoft.com... > PLEASE ANSWER A.S.A.P.!!! WORD 2007 Page Layout / Page Setup group / Columns Please hit Yes if my comments have helped. Thanks. "Kaitlyn Moreland" wrote: ...

Macro Freezes Reading Pane
I have a macro that Sends/Receives Tasks from Project Server into Outlook Tasks. Everything is working fine, except one weird thing that happens. I have the Timer set on the macro and it starts as soon as Outlook starts. The macro gets the tasks from ProjectServer every hour. As soon as the macro starts running the Reading pane freezes in the Inbox. If i stop the macro then Reading pane is back to normal. Can anyone please tell me if there is something I can do in VBA to fix this annoying issue. Thanks a lot ...

Macro to remove rows?
Hi, I receive thousands of rows of data from an extract that comes from a database. The data extract automatically generates page headers that need to be removed, and I would love to automate this process. The headers do have a pattern to them, but I'm not clever enough to figure out a good way to use that to write a macro. The first row of the header starts with hyphens ------------------------------- Then there's a variable number of rows of header data to delete followed by another row of hyphens ------------------------------- Then 2 additional rows that must be deleted. The nu...

Calling on a macro within a macro!
Hey All!! Quick Question - How do you call up a macro within a current macro? I have one big macro and I need it to jump to several other macros when it runs! Does it matter where the other macros are stored or is it better to have them all in one module? Help appreciated Thnx! Hi Mellowe, '=============>> Public Sub Main() 'Your code Call One 'your code End Sub '<<============= '=============>> Public Sub One() MsgBox "Hi from One" End Sub '<<============= > Does it matter where the other macros are stored or ...

Trend Line constants as Excel Cell Values
I want to put the constants of a 2 degree polynomial trend line into Excel Cells. Are there formula's to do this? Equation is Y = Ax(2) + Bx + C. I want the value of A,B and C in seperate cells. Can anyone suggest how this can be done? Thanks -- Ken Hi Ken, Supposing your x-range is in A2:A10, and y-range in B2:B10, select a 3-column x 1-row area and enter the following formula and confirm with CTRL-SHIFT-ENTER. =LINEST(B2:B10,A2:A10^{0,1,2},0,) Regards, B. R. Ramachandran "Ken" wrote: > I want to put the constants of a 2 degree polynomial trend line into Excel &g...

shortcut keys to macros
Hi, Is it at all possible to assign shortcut keys to macros in Outlook? Thx, Hans ...

help Unable to record Macro !!!!!!!
I want to record a macro in excel.But as soon as I click record Macro it says "unable to record" macro. Got no help in excel help.I do this same thing in word and it's working. Please help It's urgent for me !!!1 Have a look here http://groups.google.com/groups?as_epq=unable%20to%20record&as_ugroup=microsoft.public.excel.* -- Don Guillett SalesAid Software donaldb@281.com "ash" <anonymous@discussions.microsoft.com> wrote in message news:3e0b01c42ae5$45333e00$a401280a@phx.gbl... > I want to record a macro in excel.But as soon as I click > record...

NAICS Code
Hello, I have a list of NAICS codes formatted as numbers that I would like to format as hierarchical text. Current List 10 12 101 112 Desired List 10 101 112 12 Does anyone know how to change the cell format so that the "Current List" becomes the "Desired List"? Thank you in advance for your help. It looks like you could preformat that column as text and enter your values as text. Then you could sort the data as text. Some versions of excel will ask if you want to sort values that look like numbers as numbers. You should say no to that prompt. And just changing t...

Chart Label wraps on the same line. "Wavelenght [nm]" appears as.
Chart Label wraps on the same line. example "Wavelenght [nm]" appears as "}Wavelenght [nm" in general the chart labels are not what i typed. Send me a copy of the file (personal mail not to newsgroup) What version of Excel are you using? -- Bernard Liengme www.stfx.ca/people/bliengme remove CAPS in email address "rog" <rog@discussions.microsoft.com> wrote in message news:E9369578-AA4B-480B-93A2-14D91B8AC1F8@microsoft.com... > Chart Label wraps on the same line. example "Wavelenght [nm]" appears as > "}Wavelenght [nm" >...

Macro that password protects a sheet
I am attempting to create a macro that can open a protected sheet, change something, and then protect it again. I continue to have an issue with the macro not entering the password. Is this possible to do/fix? Thanks, Ryan ..open password="mypassword" -- Don Guillett SalesAid Software donaldb@281.com "Ryan" <Ryan@discussions.microsoft.com> wrote in message news:D4780ED8-CA1D-4284-97BC-3576160D998E@microsoft.com... > I am attempting to create a macro that can open a protected sheet, change > something, and then protect it again. I continue to have an iss...

Footer Macro?
Hi Months ago I read a Public Sub Macro that read the selection of a drop down list in a combo box and placed it in the center Footer at the same time it also placed the date in the right Footer and tme in the left footer. I have searched most of the regular sites including this one and cannot find it anywhere --- Can anyone help with my search. Any help much appreciated Cheers ---- Mully ...

Keyboard Shortcut in Macro
Hi all i'v created macro with Keyboard Shortcut Ctrl+b . now i want to change it to Ctrl+z how can i do it . regards Tools-->Macro-->Macros. Select (don't open!) your macro, and hit the Options button. :) ************ Hope it helps! Anne Troy www.OfficeArticles.com "osaka78" <osaka78@discussions.microsoft.com> wrote in message news:1721A458-212D-4446-8209-494A459EE428@microsoft.com... > Hi all > i'v created macro with Keyboard Shortcut Ctrl+b . now i want to change it > to > Ctrl+z > how can i do it . > > regards THE MACRO IS NO...

Macros have been disabled but there is no macro
when I open a specific doc the info bar at the top says "Macros have been disabled", but when I hit Alt+F11 I can't find any VB or a module to remove. Why is it telling me about macros? Other docs don't give me this prompt. I thought I might have to enable macros to see the code. When I enabled macro, it said "do you want to save changes to this doc?" it flickered and came back as if immediately reopened. Any ideas? I could copy and paste the text into a new doc but I'd be interested to be able to strip off this problem. The doc is an internal IT ...