View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Nasir[_2_] Nasir[_2_] is offline
external usenet poster
 
Posts: 9
Default Macro to run on all files in a folder but exclude sheets withPivot Table, Pivot Charts and Charts

On Mar 11, 3:40*am, "Clif McIrvin" wrote:
"Nasir" wrote in message

...
On Mar 8, 3:42 am, "Clif McIrvin" wrote: "Nasir" wrote in message

[ ]

Hi Clif
Thanks for your help
I changed the lines as per your instructions.

When I run the Private Sub ScanWorkbooks
I get Runtime error 1004 in Sub FormatWorksheet
Select method of Range class failed
sh.Range("A2").Select <<< this line is highlighted

Can you guide me please?

Hi Nasir

You're welcome.

I did some testing .... Range.Select and Range.Activate do not work
unless the sheet is the active sheet .... so change that one line to
these two lines:

sh.Activate
sh.Range("A2").Activate

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


Thank you sooooooooooooooooooo much
Worked like a Magician Wand

Appreciate the great help from you.
Nasir