Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Can anybody help..?

I have some code to format a sheet.

I dont know how to format all the sheets in a workbook.

Regards
Thyagaraj

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Can anybody help..?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Can anybody help..?


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Can anybody help..?

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
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



All times are GMT +1. The time now is 08:07 AM.

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

About Us

"It's about Microsoft Excel"