ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing the value in multiple sheets without selecting those sheets (https://www.excelbanter.com/excel-programming/279394-changing-value-multiple-sheets-without-selecting-those-sheets.html)

herm

Changing the value in multiple sheets without selecting those sheets
 
I have a workbook with 10 sheets and currently use the formula

sheets("sheet2").select
Range ("a1").select
Activecell.formularR1c1= "true"

and repeat this for sheet3,4,5 and so on
Note not all the values are identical some are true and some false

Because the VBA sub has to then jump to every sheet and then enter the
value it creates a flashing effect that irritates the hell out of me

Is there a code where it will make those changes in other sheets
without activating those sheets first

PLEASE Help
Thanks
Herman

Ecco[_3_]

Changing the value in multiple sheets without selecting those sheets
 
You can prevent display updating by adding row

Application.Screenupdating=False

in the beginning of your code.

Ecco

-----Original Message-----
I have a workbook with 10 sheets and currently use the

formula

sheets("sheet2").select
Range ("a1").select
Activecell.formularR1c1= "true"

and repeat this for sheet3,4,5 and so on
Note not all the values are identical some are true and

some false

Because the VBA sub has to then jump to every sheet and

then enter the
value it creates a flashing effect that irritates the

hell out of me

Is there a code where it will make those changes in other

sheets
without activating those sheets first

PLEASE Help
Thanks
Herman
.


Jan Karel Pieterse

Changing the value in multiple sheets without selecting those sheets
 
Hi,

1. You stop the flashing by using

Application.Screenupdating=False

at the beginning of the code.
Do not forget to add

Application.Screenupdating=True

at the end.

2. There is no need to select things:

sheets("sheet2").select
Range ("a1").select
Activecell.formularR1c1= "true"

Can be improved to:

sheets("sheet2").Range("a1").formulaR1c1= "true"


Regards,

Jan Karel Pieterse
Excel TA/MVP

-----Original Message-----
I have a workbook with 10 sheets and currently use the

formula

sheets("sheet2").select
Range ("a1").select
Activecell.formularR1c1= "true"

and repeat this for sheet3,4,5 and so on
Note not all the values are identical some are true and

some false

Because the VBA sub has to then jump to every sheet and

then enter the
value it creates a flashing effect that irritates the

hell out of me

Is there a code where it will make those changes in other

sheets
without activating those sheets first

PLEASE Help
Thanks
Herman
.


Herman Schoonbee

Changing the value in multiple sheets without selecting those sheets
 

Thanks Jan Karel

Or shall I say dankie boet

You realy gave me a good tip there it works like a charm


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 12:30 PM.

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