VBA for Excel - replace over several tabs

  madwab 13:12 09 Nov 04
Locked

If I select several tabs in Excel (2000) and use find/replace, it finds and replaces occurences of the target in all selected tabs. However if I use

Sheets(Array("Sheet1","Sheet2")).Select

(for example) followed by

Cells.Replace What:="xxx", Replacement:="yyy"

...only the active tab of those selected is affected. What am I missing?

Thanks

Try adding the activate line

Sheets(Array("Sheet1","Sheet2")).Select

Sheets("Sheet1").Activate

etc

HTH

  madwab 12:19 10 Nov 04

I began to realise last night that there was a distinction in VBA between selecting and activating a range of sheets, which doesn't apply when selecting the same range with the mouse. I haven't tested your suggestion yet, but I'm confident it will work - thanks!

This thread is now locked and can not be replied to.

iPhone 7 review: a range of small updates add up to an excellent phone

1995-2015: How technology has changed the world in 20 years

How New York’s Stylin’ Seniors became a golden social media campaign

23 Apple Watch tips & secret features: Master your Apple Watch, Apple Watch Series 1 or Apple…