Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
ma
 
Posts: n/a
Default Validation Data & Goto question

Hi Everyone,

I tried this on my own, but got a big headache and no result.

I have an excel spread sheet with 9 columns and about 3000 rows of
just text. One of the columns has vendor names (column F) and their
products.
So, for one vendor, there may be one or 100 products listed in rows
until next vendor starts.
On top of this column I have a "validation listbox" with the list of
vendors.

If I click & drop down the list, I can pick any one of the vendor names.
Then I wanted to go to a row containing first occurrence of that vendor's
name.

Almost like one would be using Vlookup and GoTo, but for the life of me
I just don't know how to utilize these to accomplish what I need.

Is this possible, and if yes, how?

Thanks in advance.

Mike


  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

You're better off using AutoFilter which is what you're
appearing to emulate. Nevertheless, with your Validation
list in F1, try:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim findrow As Long
Set rng = [F2:F4000]
If Not Intersect(Target, [F1]) Is Nothing Then
On Error GoTo NotFound:
findrow = Application.Match(Target.Value, rng, 0)
Application.Goto _
Reference:=rng(findrow), Scroll:=True
End If
Exit Sub
NotFound:
MsgBox "Not Found!"
End Sub

---
To use, right-click on the worksheet tab, go to View
Code, and paste in the code above. Press ALT+Q to return
to Excel.

HTH
Jason
Atlanta, GA

-----Original Message-----
Hi Everyone,

I tried this on my own, but got a big headache and no

result.

I have an excel spread sheet with 9 columns and about

3000 rows of
just text. One of the columns has vendor names (column

F) and their
products.
So, for one vendor, there may be one or 100 products

listed in rows
until next vendor starts.
On top of this column I have a "validation listbox" with

the list of
vendors.

If I click & drop down the list, I can pick any one of

the vendor names.
Then I wanted to go to a row containing first occurrence

of that vendor's
name.

Almost like one would be using Vlookup and GoTo, but for

the life of me
I just don't know how to utilize these to accomplish

what I need.

Is this possible, and if yes, how?

Thanks in advance.

Mike


.

  #3   Report Post  
ma
 
Posts: n/a
Default

Thanks, it worked great.

Mike


"Jason Morin" wrote in message
...
You're better off using AutoFilter which is what you're
appearing to emulate. Nevertheless, with your Validation
list in F1, try:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim findrow As Long
Set rng = [F2:F4000]
If Not Intersect(Target, [F1]) Is Nothing Then
On Error GoTo NotFound:
findrow = Application.Match(Target.Value, rng, 0)
Application.Goto _
Reference:=rng(findrow), Scroll:=True
End If
Exit Sub
NotFound:
MsgBox "Not Found!"
End Sub

---
To use, right-click on the worksheet tab, go to View
Code, and paste in the code above. Press ALT+Q to return
to Excel.

HTH
Jason
Atlanta, GA

-----Original Message-----
Hi Everyone,

I tried this on my own, but got a big headache and no

result.

I have an excel spread sheet with 9 columns and about

3000 rows of
just text. One of the columns has vendor names (column

F) and their
products.
So, for one vendor, there may be one or 100 products

listed in rows
until next vendor starts.
On top of this column I have a "validation listbox" with

the list of
vendors.

If I click & drop down the list, I can pick any one of

the vendor names.
Then I wanted to go to a row containing first occurrence

of that vendor's
name.

Almost like one would be using Vlookup and GoTo, but for

the life of me
I just don't know how to utilize these to accomplish

what I need.

Is this possible, and if yes, how?

Thanks in advance.

Mike


.



Reply
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
Effect of Conditional Formatting, Data Validation Bill Sturdevant Excel Discussion (Misc queries) 1 January 25th 05 11:50 PM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 05:55 PM
Data Validation Window? Ken Excel Discussion (Misc queries) 1 January 11th 05 10:48 PM
Data Validation list selection question Bob Wall Excel Worksheet Functions 2 December 4th 04 04:51 PM
Excel2K: Is it possible to use dynamic named ranges in custom data validation formula? Arvi Laanemets Excel Discussion (Misc queries) 0 December 2nd 04 11:29 AM


All times are GMT +1. The time now is 10:05 PM.

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"