PC Review


Reply
Thread Tools Rate Thread

Autofit / Remove formats VBA Code

 
 
Curt J
Guest
Posts: n/a
 
      19th Nov 2008
I would like the code for a macro that autofits and removes any wrap text or
merged cells formats to every sheet in a workbook that does not have a
colored tab.

Is this possible?

Thanks,

Curt J
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      19th Nov 2008
Sub foreachcoloredtab()
For Each ws In ThisWorkbook.Worksheets
If ws.Tab.ColorIndex < 0 Then
'MsgBox ws.Name
With ws.Cells
.WrapText = False
.MergeCells = False
.Rows.AutoFit
.Columns.AutoFit
End With
End If
Next ws
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Curt J" <(E-Mail Removed)> wrote in message
news:68ED53FF-886A-4CED-90C7-(E-Mail Removed)...
>I would like the code for a macro that autofits and removes any wrap text
>or
> merged cells formats to every sheet in a workbook that does not have a
> colored tab.
>
> Is this possible?
>
> Thanks,
>
> Curt J


 
Reply With Quote
 
Curt J
Guest
Posts: n/a
 
      20th Nov 2008
It worked perfectly. Thanks a lot.

Curt J

"Curt J" wrote:

> I would like the code for a macro that autofits and removes any wrap text or
> merged cells formats to every sheet in a workbook that does not have a
> colored tab.
>
> Is this possible?
>
> Thanks,
>
> Curt J

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      21st Nov 2008

Glad to help

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Curt J" <(E-Mail Removed)> wrote in message
news:0C703811-8C5D-4030-9637-(E-Mail Removed)...
> It worked perfectly. Thanks a lot.
>
> Curt J
>
> "Curt J" wrote:
>
>> I would like the code for a macro that autofits and removes any wrap text
>> or
>> merged cells formats to every sheet in a workbook that does not have a
>> colored tab.
>>
>> Is this possible?
>>
>> Thanks,
>>
>> Curt J


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I remove extra space when using autofit in Excel 2003? Doug Keith Microsoft Excel Misc 3 7th May 2009 03:02 AM
Autofit code Issue =?Utf-8?B?Sm9l?= Microsoft Excel Programming 0 20th Dec 2005 04:12 PM
autofit row code Randy Starkey Microsoft Excel Programming 7 25th Mar 2005 11:58 AM
Need code to Autofit Row Height on recalculation Bob Tarburton Microsoft Excel Misc 0 4th Mar 2005 08:31 PM
Open Source C# code for file formats in HTML, Word, lit (unprotected), and other formats? news.austin.rr.com Microsoft Dot NET Compact Framework 3 17th Jan 2005 04:29 AM


Features
 

Advertising
 

Newsgroups
 


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