Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Anthony
 
Posts: n/a
Default Data Validation error ??

Hi

I have a worksheet with a validation list populating cells aa5:aa20, the
actual 'drop down list' is in cell G34 but when I select an item fromn this
list I can't get the worksheet relating to the selected item to open. I have
checked to make sure all the worksheets and items on the list are exactly the
same, but with no results.

here is my code

Dim r As Range

SheetName = Range("G34")

'Set the range for the for checking changes to A1:A1.
Set r = Intersect(Range("G34:G34"), Target)

'If the change in the worksheet is not in the tested range, exit the macro.
If r Is Nothing Then Exit Sub

' Select the sheet
Sheets(SheetName).Select

End sub

Can anybody offer any help - thanks in advance
Anthony


  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi Anthony

this should work for you
---
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo err_handler
Application.EnableEvents = False
If Target.Address = "$G$34" And Not IsNull(Target.Value) Then
Sheets(Target.Value).Select
End If
err_handler:
Application.EnableEvents = True
End Sub
---
Cheers
JulieD

"Anthony" wrote in message
...
Hi

I have a worksheet with a validation list populating cells aa5:aa20, the
actual 'drop down list' is in cell G34 but when I select an item fromn
this
list I can't get the worksheet relating to the selected item to open. I
have
checked to make sure all the worksheets and items on the list are exactly
the
same, but with no results.

here is my code

Dim r As Range

SheetName = Range("G34")

'Set the range for the for checking changes to A1:A1.
Set r = Intersect(Range("G34:G34"), Target)

'If the change in the worksheet is not in the tested range, exit the
macro.
If r Is Nothing Then Exit Sub

' Select the sheet
Sheets(SheetName).Select

End sub

Can anybody offer any help - thanks in advance
Anthony




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
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
data validation on sth else [email protected] Excel Worksheet Functions 1 November 3rd 04 01:52 PM


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