Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Reset Validation cells to first list value

I have several cells that use named lists with the Validation feature on a
form. How do I reset those cells to their first list option?

Is there a way to search the form range for validated cells and then reset
them?

Thank You for any help you may be able to give : )
--
FirstVette52
  #2   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default Reset Validation cells to first list value

I suppose the list is named MyList:

http://cjoint.com/?bjuMxnT58R

Sub raz()
For Each c In Cells.SpecialCells(xlCellTypeAllValidation)
c.Value = Range("MyList")(1)
Next c
End Sub

JB
http://boisgontierjacques.free.fr

On 9 jan, 19:07, FirstVette52 <(My User name is Firstvette 52, too)
firstvet52@(my ISP E-mail provider is) netzero.com wrote:
I have several cells that use named lists with the Validation feature on a
form. *How do I reset those cells to their first list option?

Is there a way to search the form range for validated cells and then reset
them?

Thank You for any help you may be able to give : )
--
FirstVette52


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Reset Validation cells to first list value

Select all cells.

F5SpecialData ValidationOK

EditReplace

What: *

With: first list option

Replace all.


Gord Dibben MS Excel MVP

On Fri, 9 Jan 2009 10:07:00 -0800, FirstVette52 <(My User name is Firstvette
52, too) firstvet52@(my ISP E-mail provider is) netzero.com wrote:

I have several cells that use named lists with the Validation feature on a
form. How do I reset those cells to their first list option?

Is there a way to search the form range for validated cells and then reset
them?

Thank You for any help you may be able to give : )


  #4   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default Reset Validation cells to first list value

If you have many Lists:

http://cjoint.com/?bjw7iyh5Sz

Sub raz()
For Each c In Cells.SpecialCells(xlCellTypeAllValidation)
nameList = Mid(c.Validation.Formula1, 2)
c.Value = Range(nameList)(1)
Next c
End Sub

JB



On 9 jan, 19:51, JB wrote:
I suppose the list is named MyList:

http://cjoint.com/?bjuMxnT58R

Sub raz()
* For Each c In Cells.SpecialCells(xlCellTypeAllValidation)
* *c.Value = Range("MyList")(1)
* Next c
End Sub

JBhttp://boisgontierjacques.free.fr

On 9 jan, 19:07, FirstVette52 <(My User name is Firstvette 52, too)
firstvet52@(my ISP E-mail provider is) netzero.com wrote:





I have several cells that use named lists with the Validation feature on a
form. *How do I reset those cells to their first list option?


Is there a way to search the form range for validated cells and then reset
them?


Thank You for any help you may be able to give : )
--
FirstVette52- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Reset Validation cells to first list value

This looks great, however I use a different list for each validation cell. Is
there a way to refer to the cell and reset it to the first entry of its list
without referencing the list itself?

Thanks for your help!
--
FirstVette52


"JB" wrote:

I suppose the list is named MyList:

http://cjoint.com/?bjuMxnT58R

Sub raz()
For Each c In Cells.SpecialCells(xlCellTypeAllValidation)
c.Value = Range("MyList")(1)
Next c
End Sub

JB
http://boisgontierjacques.free.fr

On 9 jan, 19:07, FirstVette52 <(My User name is Firstvette 52, too)
firstvet52@(my ISP E-mail provider is) netzero.com wrote:
I have several cells that use named lists with the Validation feature on a
form. How do I reset those cells to their first list option?

Is there a way to search the form range for validated cells and then reset
them?

Thank You for any help you may be able to give : )
--
FirstVette52





  #6   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default Reset Validation cells to first list value



Put value of first element of each list:

Sub raz()
For Each c In Cells.SpecialCells(xlCellTypeAllValidation)
If Left(c.Validation.Formula1, 1) = "=" Then
NomList = Mid(c.Validation.Formula1, 2)
c.Value = Range(NomList)(1)
Else
temp = c.Validation.Formula1
a = Split(temp, ",")
c.Value = a(0)
End If
Next c
End Sub

http://cjoint.com/?bjxJWEFNK7

JB


On 9 jan, 22:15, FirstVette52 <(My User name is Firstvette 52, too)
firstvet52@(my ISP E-mail provider is) netzero.com wrote:
This looks great, however I use a different list for each validation cell.. Is
there a way to refer to the cell and reset it to the first entry of its list
without referencing the list itself?

Thanks for your help!
--
FirstVette52



"JB" wrote:
I suppose the list is named MyList:


http://cjoint.com/?bjuMxnT58R


Sub raz()
* For Each c In Cells.SpecialCells(xlCellTypeAllValidation)
* *c.Value = Range("MyList")(1)
* Next c
End Sub


JB
http://boisgontierjacques.free.fr


On 9 jan, 19:07, FirstVette52 <(My User name is Firstvette 52, too)
firstvet52@(my ISP E-mail provider is) netzero.com wrote:
I have several cells that use named lists with the Validation feature on a
form. *How do I reset those cells to their first list option?


Is there a way to search the form range for validated cells and then reset
them?


Thank You for any help you may be able to give : )
--
FirstVette52- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Reset Validation cells to first list value

I'm not very good at Visual Basic and I can't get this construct to work
(probably because I need to replace elements of the code with my own
elements).

When the code runs as posted it fails in runtime. Debugging shows c is
empty, 'For Each c...', as well as 'NomList'.

There is also a type mismatch, 'c.Value = a(0)'
--
FirstVette52


"JB" wrote:



Put value of first element of each list:

Sub raz()
For Each c In Cells.SpecialCells(xlCellTypeAllValidation)
If Left(c.Validation.Formula1, 1) = "=" Then
NomList = Mid(c.Validation.Formula1, 2)
c.Value = Range(NomList)(1)
Else
temp = c.Validation.Formula1
a = Split(temp, ",")
c.Value = a(0)
End If
Next c
End Sub

http://cjoint.com/?bjxJWEFNK7

JB


On 9 jan, 22:15, FirstVette52 <(My User name is Firstvette 52, too)
firstvet52@(my ISP E-mail provider is) netzero.com wrote:
This looks great, however I use a different list for each validation cell.. Is
there a way to refer to the cell and reset it to the first entry of its list
without referencing the list itself?

Thanks for your help!
--
FirstVette52



"JB" wrote:
I suppose the list is named MyList:


http://cjoint.com/?bjuMxnT58R


Sub raz()
For Each c In Cells.SpecialCells(xlCellTypeAllValidation)
c.Value = Range("MyList")(1)
Next c
End Sub


JB
http://boisgontierjacques.free.fr


On 9 jan, 19:07, FirstVette52 <(My User name is Firstvette 52, too)
firstvet52@(my ISP E-mail provider is) netzero.com wrote:
I have several cells that use named lists with the Validation feature on a
form. How do I reset those cells to their first list option?


Is there a way to search the form range for validated cells and then reset
them?


Thank You for any help you may be able to give : )
--
FirstVette52- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -



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
Protect List Validation Cells Kenny Excel Discussion (Misc queries) 3 October 2nd 07 06:48 AM
Get rid of empty cells when displaying Data validation list mbeauchamp Excel Discussion (Misc queries) 6 October 5th 06 09:37 PM
Remove empty cells from named list / validation list Sp00k Excel Worksheet Functions 4 April 28th 06 03:45 PM
Empty Cells in validation List Jasper Excel Worksheet Functions 1 January 28th 05 01:09 PM
Data Validation List Option Affecting Other Cells? tomrobs Excel Worksheet Functions 0 November 5th 04 07:13 PM


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