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,355
Default Worksheet Change question

This is a continuation of another thread. That was getting a bit unweildy.

I have the following code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

If Not Intersect(Target, Range("A1:A20")) Is Nothing Then
Application.EnableEvents = False
If Target.Value < "" Then
Target.Offset(0, 1).Resize(1, 4).FormulaR1C1 = _
"=VLOOKUP(RC1,DBExtract,MATCH(R1C,DBExtract!R1,0), FALSE)"
Target.Offset(0, 1).Resize(1, 4).Copy
Target.Offset(0, 1).Resize(1, 4).PasteSpecial xlValues
Else
Target.Offset(0, 1).Resize(1, 4).Value = ""
End If
Application.EnableEvents = True
End If
End Sub

I'm not seeing anything being displayed in the adjacent cells. What have I
done wrong. It worked at one time (before I added the IF TARGET.value =
""), but now I can't even get it to work at all.

Thanks,
Barb Reinhardt
 
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 question Tonso Excel Discussion (Misc queries) 1 April 20th 10 07:17 PM
worksheet change question Tonso Excel Discussion (Misc queries) 2 April 2nd 10 05:46 PM
Hyperlink Question -- Change in Worksheet Name? BG Excel Worksheet Functions 1 March 23rd 08 02:39 PM
Worksheet change Macro Question Vick Excel Discussion (Misc queries) 11 January 30th 08 03:09 PM
Worksheet Change question Kirk[_2_] Excel Programming 2 July 30th 03 11:30 PM


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