macro to create view problems

Kade

Active Member
Joined
Jul 20, 2002
Messages
258
Hi

I have a worksheet that I often duplicate (copysheet) within a book.

I need a macro to create three views for each new worksheet.

I tried but (see below) it continues to reset the same name .

How can I get the line where the viewname is named, to say insert the tab name and "A" for the first view "B" for the second, etc.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 13/09/2002 by Kade
'

'
Range("A1:G17").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$G$17"
Range("A1").Select
ActiveWorkbook.CustomViews.Add ViewName:="sht3A", PrintSettings:=True, _
RowColSettings:=True
ActiveWindow.SmallScroll ToRight:=7
Range("H1:N21").Select
ActiveSheet.PageSetup.PrintArea = "$H$1:$N$21"
Range("H1").Select
ActiveWorkbook.CustomViews.Add ViewName:="sht3B", PrintSettings:=True, _
RowColSettings:=True
End Sub


Any other solutions greatfully accepted

thanks Kade
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,147,735
Messages
5,742,889
Members
423,760
Latest member
photogfrog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top