View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default writing macros in excel sheet

On Sat, 6 May 2006 13:02:34 -0700, "Yo****ha"
wrote:

Hi
i'm new to writing macros for an excel file.

i've a macro which will read the data from worksheets and copies that data
and paste the copied data into new workbook sheets.

it is copying the data into new work sheet. whats my problem is my original
application contains formatted data like having cloros and some of the
columns having big font size etc and some of sheets contains merged cells.
i'm totally having 8 worksheets with different layouts and the macro copying
the data into 8 new worksheets but the look and feel is not similar to the
original application. But i want as it is.
cna anyone tell me how to do this
its very urgent for me

thanx in advance
jaffar


It sounds like the macro is just copying the values from the original
worksheets, and not the formatting as well.

Look for a line in the macro which says something like

Range("your_range").PasteSpecial (xlPasteValues)

If you want your new sheets to have exactly the same formulae, numbers
and formats as the old sheets, then change that to:

Range("your_range").PasteSpecial (xlPasteAll)

If you want your new worksheets to replace formulae in the old with
just values in the new, add an extra line:

Range("your_range").PasteSpecial (xlPasteFormats)






__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________