|
|
|
Author |
Message |
Janiv
|
Posted: Wed Feb 28 10:43:29 CST 2007 |
Top |
Excel Programming >> formatting a macro
I new to VB programming. I need to create a macro that will be able
to copy the sheet and then format the copy to look like the initial
sheet. Here is my copy:
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 Submacro
Please help me.
Maggie
Excel19
|
|
|
|
|
Dave
|
Posted: Wed Feb 28 10:43:29 CST 2007 |
Top |
Excel Programming >> formatting a macro
Sometimes, it's just easier to copy the worksheet--than the cells, the formats,
the headers, the footers, autofilters, ....
I'm not sure how you're creating those worksheets, but if you record a macro
when you
select the sheet to copy
edit|Move or copy sheet
(select copy)
and plop it where it belongs
You'll see the code.
Then you can clean anything you want.
>
> I new to VB programming. I need to create a macro that will be able
> to copy the sheet and then format the copy to look like the initial
> sheet. Here is my copy:
>
> 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 Submacro
>
> Please help me.
>
> Maggie
--
Dave Peterson
|
|
|
|
|
Maggie
|
Posted: Wed Feb 28 15:07:50 CST 2007 |
Top |
Excel Programming >> formatting a macro
> Sometimes, it's just easier to copy the worksheet--than the cells, the formats,
> the headers, the footers, autofilters, ....
>
> I'm not sure how you're creating those worksheets, but if you record a macro
> when you
> select the sheet to copy
> edit|Move or copy sheet
> (select copy)
> and plop it where it belongs
>
> You'll see the code.
>
> Then you can clean anything you want.
>
>
>
>
>
>
> > I new to VB programming. I need to create a macro that will be able
> > to copy the sheet and then format the copy to look like the initial
> > sheet. Here is my copy:
>
> > 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 Submacro
>
> > Please help me.
>
> > Maggie
>
> --
>
> Dave Peterson- Hide quoted text -
>
> - Show quoted text -
Okay that worked now I am having the problem of renaming the tab. I
would like to have an input box that I would be able to rename what I
want it to be. Any suggestions
|
|
|
|
|
|
|