ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multi Sheet Macro (https://www.excelbanter.com/excel-programming/306244-multi-sheet-macro.html)

dan

Multi Sheet Macro
 
I have a Workbook with 20 individual sheets. Each Sheet
has two Buttons. One is a clear the other is a Clear all
Sheets. The Clear All basicly selects all the sheets and
runs the clear button.

Sheets (Array("sheet 1", sheet 2", etc, "Sheet 20")).Select

what I want to do to reduce code and file size is
something like:

Sheets(Array("Tech 1:Tech 25")).Select

but I can't get that to work. Suggestions??

Jeff Standen

Multi Sheet Macro
 
Sheets.Select

That will select all of them.

Cheers,

Jeff

"Dan" wrote in message
...
I have a Workbook with 20 individual sheets. Each Sheet
has two Buttons. One is a clear the other is a Clear all
Sheets. The Clear All basicly selects all the sheets and
runs the clear button.

Sheets (Array("sheet 1", sheet 2", etc, "Sheet 20")).Select

what I want to do to reduce code and file size is
something like:

Sheets(Array("Tech 1:Tech 25")).Select

but I can't get that to work. Suggestions??




dan

Multi Sheet Macro
 
Sheets.select("Sheet 1:Sheet 20") doesn't work

Sheets ("Sheet 1:Sheet 20").Select doesn't work

sheet (Array( ... nothing

Sheet.Select (Array( ... nada

Errors out

-----Original Message-----
Sheets.Select

That will select all of them.

Cheers,

Jeff

"Dan" wrote in

message
...
I have a Workbook with 20 individual sheets. Each Sheet
has two Buttons. One is a clear the other is a Clear all
Sheets. The Clear All basicly selects all the sheets and
runs the clear button.

Sheets (Array("sheet 1", sheet 2", etc, "Sheet

20")).Select

what I want to do to reduce code and file size is
something like:

Sheets(Array("Tech 1:Tech 25")).Select

but I can't get that to work. Suggestions??



.


JulieD

Multi Sheet Macro
 
Hi Dan

Jeff's solution does work - it's just

sheets.select

nothing else

Cheers
JulieD

"Dan" wrote in message
...
Sheets.select("Sheet 1:Sheet 20") doesn't work

Sheets ("Sheet 1:Sheet 20").Select doesn't work

sheet (Array( ... nothing

Sheet.Select (Array( ... nada

Errors out

-----Original Message-----
Sheets.Select

That will select all of them.

Cheers,

Jeff

"Dan" wrote in

message
...
I have a Workbook with 20 individual sheets. Each Sheet
has two Buttons. One is a clear the other is a Clear all
Sheets. The Clear All basicly selects all the sheets and
runs the clear button.

Sheets (Array("sheet 1", sheet 2", etc, "Sheet

20")).Select

what I want to do to reduce code and file size is
something like:

Sheets(Array("Tech 1:Tech 25")).Select

but I can't get that to work. Suggestions??



.




No Name

Multi Sheet Macro
 
AAAAAAAAAAAaaahhhhhhhhhhhhhhhhhhhhhhhhh!!! *light goes on*

Thanks
-----Original Message-----
Hi Dan

Jeff's solution does work - it's just

sheets.select

nothing else

Cheers
JulieD

"Dan" wrote in

message
...
Sheets.select("Sheet 1:Sheet 20") doesn't work

Sheets ("Sheet 1:Sheet 20").Select doesn't work

sheet (Array( ... nothing

Sheet.Select (Array( ... nada

Errors out

-----Original Message-----
Sheets.Select

That will select all of them.

Cheers,

Jeff

"Dan" wrote in

message
...
I have a Workbook with 20 individual sheets. Each

Sheet
has two Buttons. One is a clear the other is a Clear

all
Sheets. The Clear All basicly selects all the sheets

and
runs the clear button.

Sheets (Array("sheet 1", sheet 2", etc, "Sheet

20")).Select

what I want to do to reduce code and file size is
something like:

Sheets(Array("Tech 1:Tech 25")).Select

but I can't get that to work. Suggestions??


.



.



All times are GMT +1. The time now is 10:31 AM.

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