Format sheet programmaticlly??

M

Mekinnik

Is it possible and how do you format a sheet programmaticlly in VBA. I would
like to format a newly created sheet once the data is copied or when the data
is copied from another sheet. I would like to format the new sheets with
borders and header rows with bold names to match the coorisponding data in
that column.
 
P

Per Jessen

Hi

Record a macro where you format the sheet as desired, then incorporate
the recorded code in your own code.

Regards,

Per
 
S

SteveM

Is it possible and how do you format a sheet programmaticlly in VBA. I would
like to format a newly created sheet once the data is copied or when the data
is copied from another sheet. I would like to format the new sheets with
borders and header rows with bold names to match the coorisponding data in
that column.

The easiest way to generate formatting code is to create a template of
what the populated sheet would look like and then format it as desired
with the macro recorder turned on. Then go back and make any
customized adjustments to the macro that are required and you're done.

A real key for making your life easier is to use named ranges and
format on the range names rather than specific cell addresses. That
way, if the range dimensions change, you don't have to go back into
the code and change the range designations. There are other methods
for dynamic range selection, but this is a good way to start.

Try those first and see how you make out.

Good Luck.

SteveM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top