Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help: VBA macro for worksheet formatting

Dear All:


I have following task but don't know how to get it done in VBA:

I created a few data listings in a EXCEL file - each listing is a
worksheet in this file. Every worksheet/listing has its own formatting
(basically the fonts, sizes and widths of each column) and I can
create different VBA macros to do formatting for every worksheet. My
question is: how can I create a VBA macro in PERSONAL.XLS to
automatically finish these steps (if this is possible):

1) open this EXCEL file
2) open each worksheet by its name, one by one
3) call formatting VBA macro for this active sheet and run it
(of course, these formatting macros will all be stored in
PERSONAL.XLS)
4) after finishing the formatting for active worksheet, go to next one
and do the same thing until all formatting is done
5) close EXCEL file and exit

The reason I want to get everything done from one VBA macro in
PERSONAL.XLS is that programs in other languages can use DDE to run
this macro.

Thank you very much for any information or sample codes to do similar
functions.


Y. Lin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default VBA macro for worksheet formatting

You need to go through the sheets collection. Examples are in
http://www.mvps.org/dmcritchie/excel/collections.htm
and in
http://www.mvps.org/dmcritchie/excel...#sortallsheets

Try recording a macro to get the code for the other parts..
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"ylin" wrote in message om...
Dear All:


I have following task but don't know how to get it done in VBA:

I created a few data listings in a EXCEL file - each listing is a
worksheet in this file. Every worksheet/listing has its own formatting
(basically the fonts, sizes and widths of each column) and I can
create different VBA macros to do formatting for every worksheet. My
question is: how can I create a VBA macro in PERSONAL.XLS to
automatically finish these steps (if this is possible):

1) open this EXCEL file
2) open each worksheet by its name, one by one
3) call formatting VBA macro for this active sheet and run it
(of course, these formatting macros will all be stored in
PERSONAL.XLS)
4) after finishing the formatting for active worksheet, go to next one
and do the same thing until all formatting is done
5) close EXCEL file and exit

The reason I want to get everything done from one VBA macro in
PERSONAL.XLS is that programs in other languages can use DDE to run
this macro.

Thank you very much for any information or sample codes to do similar
functions.


Y. Lin



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
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM
How to end macro on inital active worksheet containing macro button that was clicked Silverhawk1 Excel Programming 2 May 14th 04 03:58 PM
How? Macro to copy range to new worksheet, name new worksheet, loop Repoman Excel Programming 9 October 9th 03 01:45 PM
macro to apply worksheet event to active worksheet Paul Simon[_2_] Excel Programming 3 August 7th 03 02:50 AM
Record Worksheet Content as Macro and Execute from another Worksheet David McRitchie[_2_] Excel Programming 2 July 23rd 03 09:43 AM


All times are GMT +1. The time now is 08:39 AM.

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"