LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default worksheet change problem

Hi,

I'm having problems with the code below, and wondered if anybody had any
ideas.

Basically, the code is supposed to tell an autofilter which value to filter
on. This is supposed to be prompted when a certain cell (H3) has the value
entered into it. And the code is supposed to run automatically when the
spreadsheet is opened.

I'm happy with the autofilter part of the code, and (when I take out the
part that is supposed to update the autofilter when a new value is entered
in H3), I'm also happy with the part which makes the code run when the
spreadsheet is opened. My question therefore is: what is wrong about the
worksheet_change part of the function? (And am I calling it correctly from
workbook_open?)

I should point out that I'm a bit of a newbie, so please assume I don't know
anything if you answer!



Private Sub workbook_open()
Call worksheet_change
End Sub

Public Sub worksheet_change(ByVal target As Range)
End Sub
If Intersect(target, Range("h3")) Is Nothing Then
Exit Sub
Else
Sub filterthing()
With Sheet1

.AutoFilterMode = False
.Range("A10:M5000").AutoFilter
.Range("A10:M5000").AutoFilter Field:=5, Criteria1:=Range("h3").Text

End With

End Sub






Many thanks


 
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
Worksheet Change by Value problem Jim G Excel Discussion (Misc queries) 3 October 2nd 07 12:59 PM
Worksheet Change event problem Graham Haughs Excel Programming 4 November 16th 06 09:03 PM
Worksheet Change Problem Pflugs Excel Programming 0 July 18th 06 10:42 PM
Worksheet Change Event Problem tim Excel Programming 9 March 28th 05 08:37 AM
Worksheet Change Sub problem jwlabno Excel Programming 1 November 14th 03 10:49 PM


All times are GMT +1. The time now is 11:46 AM.

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

About Us

"It's about Microsoft Excel"