Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Shorter Code

Is there any way I can make the following a bit more code efficient?
Thanks in advance
Sandy

Sheets("Chart Data").Select
ActiveWindow.DisplayHeadings = True

Sheets("Info").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data2").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data3").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data4").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data5").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data6").Select
ActiveWindow.DisplayHeadings = True

Etc Etc


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Shorter Code

for each sh in worksheets
sh.Activate
ActiveWindow.DisplayHeadings = True
Next

--
Regards,
Tom Ogilvy


"Sandy" wrote:

Is there any way I can make the following a bit more code efficient?
Thanks in advance
Sandy

Sheets("Chart Data").Select
ActiveWindow.DisplayHeadings = True

Sheets("Info").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data2").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data3").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data4").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data5").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data6").Select
ActiveWindow.DisplayHeadings = True

Etc Etc



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Shorter Code

Works a treat!
Thanks Tom
Sandy

"Tom Ogilvy" wrote in message
...
for each sh in worksheets
sh.Activate
ActiveWindow.DisplayHeadings = True
Next

--
Regards,
Tom Ogilvy


"Sandy" wrote:

Is there any way I can make the following a bit more code efficient?
Thanks in advance
Sandy

Sheets("Chart Data").Select
ActiveWindow.DisplayHeadings = True

Sheets("Info").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data2").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data3").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data4").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data5").Select
ActiveWindow.DisplayHeadings = True

Sheets("Chart Data6").Select
ActiveWindow.DisplayHeadings = True

Etc Etc





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shorter way Oldjay Excel Discussion (Misc queries) 1 May 5th 08 05:12 PM
Shorter Sub Pete Excel Programming 7 April 9th 05 01:22 AM
Shorter code Stu[_13_] Excel Programming 13 September 29th 03 11:27 PM
Shorter code Stu[_12_] Excel Programming 0 September 28th 03 07:32 PM
shorter way? Me ![_3_] Excel Programming 0 September 15th 03 06:12 PM


All times are GMT +1. The time now is 10:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"