Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro from Sheet to Sheet

Status
Not open for further replies.

Sandman007

Programmer
Jun 20, 2001
47
US
In my excel workbook I have one sheet that acts as my switchboard. I have buttons on this worksheet that contain macros. Each macro is a month that will hide certain cells on another worksheet that contains my data. However when I run my macro I am having a compile error that stops at this line of code... (Sheets("Main View").Select

Sub JanPrintView()
'
' JanPrintView Macro
'
Sheets("Main View").Select
Columns("F:BB").Select
Selection.EntireColumn.Hidden = False
Columns("K:BB").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=-5
ActiveWindow.SmallScroll Down:=100
ActiveWindow.ScrollRow = 4
End Sub

Please Help Me! Thanks!
 
Sandman007,

I tested your code and couldn't come up with an error.

Is it possible that the problem lies with something simple like you changed your sheet name ? ... and forgot that you had done so.

Or, depending on the version of Excel, perhaps you now need to use "Worksheets" instead of just "Sheets" ? I tried both and they work.

Hope this helps.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Or maybe the sheet as named in the tab has and extra space trailing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top