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: 1
Default 424 error on a Worksheet Change Macro


Hi.
I have a Worksheet Change routine that doesn't do anything when the
Target range is changed. When I run the any of the lines of code after
the Else statement in the Immediate Window, it produces a 424 error
Object required. I'm just not seeing/understanding the problem. Need
some help please

Here is the code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range, res As String
Dim wks1 As Worksheet, wks2 As Worksheet, wks3 As Worksheet

Set wks1 = Worksheets("Status Log")
Set wks2 = Worksheets("Setup Sheet")
Set wks3 = ActiveSheet
Set rng = wks1.Range("SVDBStatusLog") 'multiple column database

If Target.Address = "$D$1" Then
res = Application.VLookup(Target, rng, 1, False)
If IsError(res) Then
wks3.Range("D2:D6").Value = "Not in Database, " & _
"manual entry required"
Else
wks3.Range("D2").Value = Application.VLookup(Target, _
rng, 4, False)
wks3.Range("D3").Value = Application.VLookup(Target, _
rng, 5, False)
wks3.Range("D4").Value = wks2.Range("Job_Name")
wks3.Range("D5").Value = Application.VLookup(Target, _
rng, 11, False)
wks3.Range("D6").Value = Application.VLookup(Target, _
rng, 11, False)
End If
End If

End Sub


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=572420

 
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
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
error with macro to name new worksheet with cell from old worksheet Moon Excel Programming 4 November 14th 05 07:13 AM
worksheet change event error events disabled Peter[_21_] Excel Programming 2 July 10th 04 08:45 AM


All times are GMT +1. The time now is 06:51 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"