Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 72
Default Worksheet Code

I have an excel spreadsheet 2003 which I use to sort information. On the
index sheet I have buttons with macros that hide certain columns and then
sort information on the remaining column in sheet 2. If a user doesn't unsort
when they return to the index sheet this creates a problem the next time
someone sorts using a button.
I have inserted an unsort code into the buttons so that it will unsort first
and unhide the columns then run the sort macro which works really well.
Someone suggested I put the unsort code into the index sheet code which I
have but it doesn't work.

Private Sub Worksheet_Activate()

Sheets("Contact Numbers").Select
Selection.AutoFilter Field:=3
Columns("D:S").Select
Selection.EntireColumn.Hidden = False
Sheets("Index").Select
Range("A1").Select
End Sub

The error starts at the Columns("D:S").Select with the message
Select method of range class failed

Can someone suggest a solution to this please.

Thankyou Kerry

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the code for the active worksheet? Dr Dan[_2_] Excel Discussion (Misc queries) 12 February 23rd 07 03:12 PM
VBA Code for selecting worksheet Marie Bayes Excel Discussion (Misc queries) 5 January 11th 07 12:37 PM
Need Worksheet Code jacob Excel Worksheet Functions 3 March 17th 06 07:48 PM
worksheet code nowfal Excel Discussion (Misc queries) 1 August 19th 05 08:25 PM
Code to determine name of Worksheet Ant Excel Discussion (Misc queries) 6 May 24th 05 01:57 PM


All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"