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: 100
Default Use VBA to reset data validation (=list) value to first value in that list (list is a named range)

I have a cell that has data validation (=list), populated by a named range

In my VBA, I need to be able to reset that list to the first value in the
list. I had the code working, but I must have tweaked something without
knowing it, and now it doesn't work anymore.

If Target.Address = "$B$2" Then
'just reset the date back to earliest date in the list
S = Sheet12.Range("E2").Validation.Formula1
Sheet12.Activate
Sheet12.Range("E2").Value = Range(S)(1) '<- this is the line that
doesn't work
Set Target = Sheet12.Range("E2")
End If

Thanks for any advice,
Keith


 
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
Data Validation List from a Dynamic Named Range on Another Workshe Jeremy Excel Worksheet Functions 5 March 29th 10 09:26 AM
Finding first value in named range referred to in data validation list ker_01 Excel Programming 2 October 4th 08 04:52 AM
Remove empty cells from named list / validation list Sp00k Excel Worksheet Functions 4 April 28th 06 03:45 PM
Dynamic Named Range inside a Data Validation list ? Richard[_34_] Excel Programming 5 March 11th 06 01:58 PM
Using a data validation list to look up a defined named range in another worksheet Laura Hunt Charts and Charting in Excel 0 November 24th 05 02:29 PM


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