Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data Validation List Problem

Hi everyone
My code bugs out, at my second validation list. This works if I do in the
spreadsheet without code, but it doesn't work with my code. If anyone can
suggest anything it would be great!
For i = 1 To nMembers
startPoint.Offset(i, 0).EntireRow.Insert
startPoint.Offset(i, 0) = i
startPoint.Offset(i, 3).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:=_ xlBetween, Formula1:="=Sections"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
startPoint.Offset(i, 4).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween,
Formula1:="=INDIRECT(SUBSTITUTE($D$24,"""""""",""" """""))"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Next i
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Data Validation List Problem

first I would try running the code without the insert row. Inserting a row
can really cause problems with the rest of the code. You can add the Insert
row at the end of the program after you perform the other operations

Also this code requires two validation lists on each row. One in an offset
of 3 and the other in an offset of 4 from startpoint. If you don't have a
validation in each row and each column you will fail the delete operation.

"chacha" wrote:

Hi everyone
My code bugs out, at my second validation list. This works if I do in the
spreadsheet without code, but it doesn't work with my code. If anyone can
suggest anything it would be great!
For i = 1 To nMembers
startPoint.Offset(i, 0).EntireRow.Insert
startPoint.Offset(i, 0) = i
startPoint.Offset(i, 3).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:=_ xlBetween, Formula1:="=Sections"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
startPoint.Offset(i, 4).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:= _
xlBetween,
Formula1:="=INDIRECT(SUBSTITUTE($D$24,"""""""",""" """""))"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Next i

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
Crazy Data Validation ... List Validation Not Working TW Bake Excel Programming 1 March 29th 07 02:41 AM
Edit problem for data validation drop down list purpletigerface Excel Worksheet Functions 4 February 28th 07 12:15 AM
Loop + Data validation list + e-mail problem VBA Noob[_39_] Excel Programming 2 August 11th 06 09:37 PM
Problem with Data Validation Dropdown List / Worksheet_Change Event [email protected] Excel Programming 1 August 9th 06 10:21 PM
Data Validation Drop-Down List Problem AmberLeaf Excel Programming 8 July 20th 05 11:03 PM


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