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: 206
Default setting a range using a named list in vba

when a customer is chosen on my order worksheet, the change event triggers
the following code:

<BEGIN VBA CODE
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub

' Column for Notes is AC (29)
' Starting row is 8


If Target.Column = 3 Then
If Target.Row = 8 Then
Dim n, x As Range, off As Integer, c As String
With Sheets("Work Order")
Set x = Range("CustomerList")
End With
off = 7 + Application.WorksheetFunction.Match(Range("C8"), x, 0)
c = "$AC$" & off
With Sheets("Customers")
Set n = .Range(.Range(c))
End With
' popup notes about customer
MsgBox n.Value
End If
End If

End Sub

<END VBA CODE

what it should do is look in C8, and then find at which location that
customer is in the list (Thanks to Tom for the Match help!). Then add 7 to it
- as the first entry in my customer list is in row 8.

i am getting an error on
Set x = Range("CustomerList")

CustomerList is a named list in my workbook - in fact it is the source for
cell C8

what am i missing?

thanks!

J
 
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
Named range list Murray Excel Discussion (Misc queries) 2 May 16th 08 01:20 AM
List Box - For Input Range can I use named range in another workbo dim Excel Worksheet Functions 2 January 3rd 08 06:10 PM
Multiple instances of a named range, not in the list DaveO[_2_] Excel Discussion (Misc queries) 4 April 16th 07 10:34 PM
How can I use a named range for "pick from drop-down list"? InstantZen Excel Discussion (Misc queries) 7 May 24th 05 12:51 AM
Setting named range in VBA- how to set as formula/reference instead of text string? Keith R[_3_] Excel Programming 1 July 28th 03 10:26 PM


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