PC Review


Reply
Thread Tools Rate Thread

Default Cell Values at Change

 
 
TheDrescher
Guest
Posts: n/a
 
      28th Apr 2010
I keep getting stuck on a workbook I'm finishing up. Basically it displays
information on a front sheet that pulls from arrays on other sheets based on
a drop down selection (employee name) in cell A9. There is one other cell on
the front sheet (which I've named CoachRating) which is a drop down list that
affects some metrics on the arrays. My problem is, when someone changes the
employee name in cell A9, the value in the CoachRating cell stays at whatever
was selected for the previous name. I'd like to have it set at a default
value (Select) whenever a change is made to cell A9. I've written this code
so far, but I keep getting an error:

Private Sub Worksheet_Change(ByVal Target As Range)

Const empNameCell = "$A$9"
Const csSheetName = "MainPage"
Const csCell = "CoachRating"
Const csDefault = "Select"

If Target.Address <> empNameCell Then

Exit Sub
End If
SalesManagersCoachingReport.Worksheets(MainPage).Range(CoachRating) =
csDefault

End Sub

I keep getting a runtime '424' error stating 'object required' and
highlighting this line in the script debugger:
SalesManagersCoachingReport.Worksheets(MainPage).Range(CoachRating) =
csDefault

Is there something I'm doing wrong here? Thanks!
 
Reply With Quote
 
 
 
 
Jim Thomlinson
Guest
Posts: n/a
 
      28th Apr 2010
A few problems here...

What is SalesManagersCoachingReport?
MainPage is the returned value of the constant csSheetName. Not sure why you
have set that as a constant. Same deal with CoachRating

Perhaps

Worksheets("MainPage").Range("CoachRating") = "Select"

I assume CoachRating is a named range.



--
HTH...

Jim Thomlinson


"TheDrescher" wrote:

> I keep getting stuck on a workbook I'm finishing up. Basically it displays
> information on a front sheet that pulls from arrays on other sheets based on
> a drop down selection (employee name) in cell A9. There is one other cell on
> the front sheet (which I've named CoachRating) which is a drop down list that
> affects some metrics on the arrays. My problem is, when someone changes the
> employee name in cell A9, the value in the CoachRating cell stays at whatever
> was selected for the previous name. I'd like to have it set at a default
> value (Select) whenever a change is made to cell A9. I've written this code
> so far, but I keep getting an error:
>
> Private Sub Worksheet_Change(ByVal Target As Range)
>
> Const empNameCell = "$A$9"
> Const csSheetName = "MainPage"
> Const csCell = "CoachRating"
> Const csDefault = "Select"
>
> If Target.Address <> empNameCell Then
>
> Exit Sub
> End If
> SalesManagersCoachingReport.Worksheets(MainPage).Range(CoachRating) =
> csDefault
>
> End Sub
>
> I keep getting a runtime '424' error stating 'object required' and
> highlighting this line in the script debugger:
> SalesManagersCoachingReport.Worksheets(MainPage).Range(CoachRating) =
> csDefault
>
> Is there something I'm doing wrong here? Thanks!

 
Reply With Quote
 
TheDrescher
Guest
Posts: n/a
 
      28th Apr 2010
Thanks for the help Jim! SalesManagersCoachingReport was the name of the
workbook file. Yes, CoachRating was is a named range simply because it
affects performance metrics on the other sheets and it was easier to
reference that way as opposed to a cell number. Thanks again!

"Jim Thomlinson" wrote:

> A few problems here...
>
> What is SalesManagersCoachingReport?
> MainPage is the returned value of the constant csSheetName. Not sure why you
> have set that as a constant. Same deal with CoachRating
>
> Perhaps
>
> Worksheets("MainPage").Range("CoachRating") = "Select"
>
> I assume CoachRating is a named range.
>
>
>
> --
> HTH...
>
> Jim Thomlinson
>
>
> "TheDrescher" wrote:
>
> > I keep getting stuck on a workbook I'm finishing up. Basically it displays
> > information on a front sheet that pulls from arrays on other sheets based on
> > a drop down selection (employee name) in cell A9. There is one other cell on
> > the front sheet (which I've named CoachRating) which is a drop down list that
> > affects some metrics on the arrays. My problem is, when someone changes the
> > employee name in cell A9, the value in the CoachRating cell stays at whatever
> > was selected for the previous name. I'd like to have it set at a default
> > value (Select) whenever a change is made to cell A9. I've written this code
> > so far, but I keep getting an error:
> >
> > Private Sub Worksheet_Change(ByVal Target As Range)
> >
> > Const empNameCell = "$A$9"
> > Const csSheetName = "MainPage"
> > Const csCell = "CoachRating"
> > Const csDefault = "Select"
> >
> > If Target.Address <> empNameCell Then
> >
> > Exit Sub
> > End If
> > SalesManagersCoachingReport.Worksheets(MainPage).Range(CoachRating) =
> > csDefault
> >
> > End Sub
> >
> > I keep getting a runtime '424' error stating 'object required' and
> > highlighting this line in the script debugger:
> > SalesManagersCoachingReport.Worksheets(MainPage).Range(CoachRating) =
> > csDefault
> >
> > Is there something I'm doing wrong here? Thanks!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
default values in a cell KRK Microsoft Excel New Users 1 31st Oct 2009 05:28 PM
SET DEFAULT VALUES IN CELL TO RECORD NEGATIVE =?Utf-8?B?UHJhc2FkIEdvcGluYXRo?= Microsoft Excel Misc 3 24th Nov 2006 01:01 AM
Default Cell Values & Save Changes Dialog Box =?Utf-8?B?dGltZw==?= Microsoft Excel Misc 2 4th Nov 2005 09:16 PM
change default values Jindrich Saur Windows XP Basics 1 5th Aug 2004 02:28 PM
Default cell values...etc Michelle Microsoft Excel Discussion 1 17th Oct 2003 02:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 AM.