Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some code to format a sheet.
I dont know how to format all the sheets in a workbook. Regards Thyagaraj |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Thyagaraj,
you could make use of a For Each...Next Loop to format all worksheets in a workbook one by one. Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets 'your code Next 'ws Regards, Ingolf Thyagaraj schrieb: I have some code to format a sheet. I dont know how to format all the sheets in a workbook. Regards Thyagaraj |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Ingolf wrote: Hi Thyagaraj, you could make use of a For Each...Next Loop to format all worksheets in a workbook one by one. Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets 'your code Next 'ws Regards, Ingolf Thyagaraj schrieb: I have some code to format a sheet. I dont know how to format all the sheets in a workbook. Regards Thyagaraj Hi Ingolf, It seems the code is not working . I dont know the reason. Regards Thyagaraj |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Thyagaraj,
I forgot to say that in your code you have to use the "ws" variable to refer to the worksheet correctely. i.e. the following code will format cell A1 in bold font on each worksheet of your workbook. Sub font_bold() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets 'refer to the worksheet by using the ws variable in your own code like this ws.Range("A1").Font.Bold = True Next 'ws End Sub Regards Ingolf |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|