Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Questions of Great Import

Well... to me anyways...

O.k. First, is there a faster way to do this:

For Each c In ActiveSheet.UsedRange
If c.Formula Like "=*" Then
c.Font.Italic = True
Else
c.Font.Italic = False
End If
Next

And second, how do I do something For Each Sheet in Workbooks("This Workbook")? I've tried doing that, and it doesn't seem to be working.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Questions of Great Import

Are you trying to make all cells with formulas italic? If so, use
the following line of code (all on one line)

ActiveSheet.UsedRange.SpecialCells(xlCellTypeFormu las).Font.Itali
c = True

You can iterate through worksheets with code like

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
' do something with WS
Next WS


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"The Wonder Thing"
wrote in message
...
Well... to me anyways...

O.k. First, is there a faster way to do this:

For Each c In ActiveSheet.UsedRange
If c.Formula Like "=*" Then
c.Font.Italic = True
Else
c.Font.Italic = False
End If
Next

And second, how do I do something For Each Sheet in

Workbooks("This Workbook")? I've tried doing that, and it doesn't
seem to be working.


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
If Formula great than 7 scenarios William G Excel Discussion (Misc queries) 4 June 27th 08 01:46 AM
What Formula to use(VBA will be great to) Need help with sumif Excel Discussion (Misc queries) 2 May 17th 06 07:09 AM
Help on any part of this would be great Jimmycooker Excel Discussion (Misc queries) 0 February 7th 06 10:21 AM
THIS IS A GREAT SITE! THANK YOU!!!! Excel User Excel Discussion (Misc queries) 1 August 8th 05 06:38 PM
Great discovery? David Excel Worksheet Functions 0 May 12th 05 08:25 AM


All times are GMT +1. The time now is 02:04 PM.

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

About Us

"It's about Microsoft Excel"