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

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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
Back
Top