ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problem with formatting text in every worksheet same workbook (https://www.excelbanter.com/excel-programming/344471-problem-formatting-text-every-worksheet-same-workbook.html)

Moon

problem with formatting text in every worksheet same workbook
 
Hi all,
I have a simple code below that is supposed to bold specific cells in
each worksheet same workbook but is not doing the job. Can anyone help?

Sub Format_All_Worksheets()
Dim sh As Worksheet

For Each sh In ThisWorkbook.Worksheets

With sh.Range("A:2,A:10,A:19,A:24,A:33,A:81").Font.Bold = True

End With

Next sh


End Sub

TIA,
Moon


Carlos[_6_]

problem with formatting text in every worksheet same workbook
 
Hi Moon

Try

Sub Format_All_Worksheets()
Dim sh As Worksheet

For Each sh In ThisWorkbook.Worksheets

sh.Range("A2,A10,A19,A24,A33,A81").Font.Bold = True

Next sh
End Sub

"Moon" wrote in message
ups.com...
Hi all,
I have a simple code below that is supposed to bold specific cells in
each worksheet same workbook but is not doing the job. Can anyone help?

Sub Format_All_Worksheets()
Dim sh As Worksheet

For Each sh In ThisWorkbook.Worksheets

With sh.Range("A:2,A:10,A:19,A:24,A:33,A:81").Font.Bold = True

End With

Next sh


End Sub

TIA,
Moon




Moon

problem with formatting text in every worksheet same workbook
 
Hi Carlos,
Thanks! That was so overlooked!
Moon



All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com