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 Drop down selection inserts value in new cell

I picked up some code that allows me to select an item from a drop
down and it displays a corresponding value. But it replaces the drop
down selection - what I want it to do is display the drop down
selection in the current cell and place the corresponding value in the
cell next to it. I'm terrible at VB coding and would like some help
tweaking this code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range, res As Variant
On Error GoTo ErrHandler
If Target.Address = "$B$6" Then
Set rng = Worksheets("Sheet2").Range("statute")
res = Application.Match(Target, rng, 0)
If Not IsError(res) Then
Application.EnableEvents = True
Target.Value = rng(res, 2)
End If
End If
ErrHandler:
Application.EnableEvents = True
End Sub

I'm hoping someone can answer quickly - have project due tomorrow.
 
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
cell value based on selection from drop box Esra[_4_] Excel Worksheet Functions 3 May 31st 09 06:52 AM
Can selection from text drop-down dictate value in another cell Relating text to values in drop-downs Excel Worksheet Functions 3 February 20th 09 08:50 PM
drop down list that changes cell color upon selection Jay Excel Discussion (Misc queries) 13 June 6th 08 09:52 AM
Selection of Drop down list that allows you to go to a particular cell Daphne Excel Worksheet Functions 2 June 14th 06 09:54 AM
Drop Down List Selection... Then go to The Cell / Range John[_78_] Excel Programming 3 October 30th 04 12:09 AM


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