![]() |
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. |
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. |
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 |
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. |
All times are GMT +1. The time now is 11:28 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com