ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formatting of all sheets at a time (https://www.excelbanter.com/excel-worksheet-functions/162562-formatting-all-sheets-time.html)

Radhakrishna k.v.n.r[_2_]

Formatting of all sheets at a time
 
Hi all,

I am Radha krishna, I am having a doubt in Excel VBA programming. In our
work we are doing formats such as Merging, row banding, Button creation,
Print area setting, Hidding and deleting of rows and columns etc. At present
we are doing that in a for loop by selecting each sheet at a time and
applying all the formats and selecting the next sheet and do the same things.
My doubt is whether Is there any way to do these common operations for all
sheets at a time or not? If so Please help me.

Bob Phillips

Formatting of all sheets at a time
 
Some things maybe, but maybe not all.

But is there a problem doing it the way that you do?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Radhakrishna k.v.n.r" wrote in
message ...
Hi all,

I am Radha krishna, I am having a doubt in Excel VBA programming. In our
work we are doing formats such as Merging, row banding, Button creation,
Print area setting, Hidding and deleting of rows and columns etc. At
present
we are doing that in a for loop by selecting each sheet at a time and
applying all the formats and selecting the next sheet and do the same
things.
My doubt is whether Is there any way to do these common operations for all
sheets at a time or not? If so Please help me.




JW[_2_]

Formatting of all sheets at a time
 
On Oct 17, 11:44 pm, Radhakrishna k.v.n.r
wrote:
Hi all,

I am Radha krishna, I am having a doubt in Excel VBA programming. In our
work we are doing formats such as Merging, row banding, Button creation,
Print area setting, Hidding and deleting of rows and columns etc. At present
we are doing that in a for loop by selecting each sheet at a time and
applying all the formats and selecting the next sheet and do the same things.
My doubt is whether Is there any way to do these common operations for all
sheets at a time or not? If so Please help me.


Are you actually selecting the sheets within the For Loop? If so,
that is not necessary. Also, if you are selecting the cells that you
wish to format within the loop, that also is not necessary. You can
use something like:

Sub this()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Range("A1:C1").MergeCells = True
Columns(4).Font.Bold = True
Range("C5").Interior.ColorIndex = 37
Next ws
End Sub


Radhakrishna k.v.n.r[_2_]

Formatting of all sheets at a time
 
The problem is its taking more time.

"Bob Phillips" wrote:

Some things maybe, but maybe not all.

But is there a problem doing it the way that you do?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Radhakrishna k.v.n.r" wrote in
message ...
Hi all,

I am Radha krishna, I am having a doubt in Excel VBA programming. In our
work we are doing formats such as Merging, row banding, Button creation,
Print area setting, Hidding and deleting of rows and columns etc. At
present
we are doing that in a for loop by selecting each sheet at a time and
applying all the formats and selecting the next sheet and do the same
things.
My doubt is whether Is there any way to do these common operations for all
sheets at a time or not? If so Please help me.





Sandy Mann

Formatting of all sheets at a time
 
If the same cells in each sheet are formatted the same way why not group the
sheet, (using code), then make the changes in sheet 1 only to do the whole
job.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Radhakrishna k.v.n.r" wrote in
message ...
The problem is its taking more time.

"Bob Phillips" wrote:

Some things maybe, but maybe not all.

But is there a problem doing it the way that you do?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Radhakrishna k.v.n.r" wrote
in
message ...
Hi all,

I am Radha krishna, I am having a doubt in Excel VBA programming. In
our
work we are doing formats such as Merging, row banding, Button
creation,
Print area setting, Hidding and deleting of rows and columns etc. At
present
we are doing that in a for loop by selecting each sheet at a time and
applying all the formats and selecting the next sheet and do the same
things.
My doubt is whether Is there any way to do these common operations for
all
sheets at a time or not? If so Please help me.









All times are GMT +1. The time now is 11:28 AM.

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