Formatting for a Macro

M

Maggie

I have a button that I press on one worksheet that will copy and
insert another worksheet. The only problem is that once I hit that
button, the formatting does not follow. Is there a way that I can
make the macro do this?
 
F

Fred Smith

Yes, the macro can be made to copy the formatting.

Post the macro, and what formatting you want copied (ie, range of cells).
 
M

Maggie

Yes, the macro can be made to copy the formatting.

Post the macro, and what formatting you want copied (ie, range of cells).

--
Regards,
Fred






- Show quoted text -

Fred,
Here is the macro:
Sub WorksheetCopy()
'
' WorksheetCopy Macro
' Macro recorded 02/26/2007 by fhlbsyh
'

'
Application.Run "'HOEPACalc-final(2).xls'!Sheet19.InsertSheets2"
Sheets("HOEPA Worksheet").Select
Application.Goto Reference:="Anti_Predatory_Lending_Worksheet"
Selection.Copy
Sheets("Loanxys").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Range("D17").Select
End Sub

I want the range to be A1:H71. That is my sheet.
 
F

Fred Smith

What does 'HOEPACalc-final(2).xls'!Sheet19.InsertSheets2 do? Is this the macro
which inserts the new sheet?

On sheet Loanxys, where is the active cell?

If you are doing an xlPasteAll, it should copy formats as well. However, you can
simplify your code, and maybe solve your problem by replacing:

Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

with:

ActiveSheet.Paste
 
Top