Questions of Great Import

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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(xlCellTypeFormulas).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" <[email protected]>
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top