ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   add method of validation failing (https://www.excelbanter.com/excel-programming/327748-add-method-validation-failing.html)

Mark Kubicki

add method of validation failing
 
and i can't figure out why...

cells in range j15: j20 contan test values 12,34,56,78...


Private Sub CommandButton1_Click()
With Range("J24")
.Borders(xlEdgeLeft).Weight = xlThin
.Borders(xlEdgeRight).Weight = xlThin
With .Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertWarning,
Operator _
:=xlBetween, Formula1:="=$j$15:$j$20"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "lit title"
.ErrorTitle = "waninng title"
.InputMessage = "input message"
.ErrorMessage = "warning messge"
.ShowInput = True
.ShowError = True
End With
End With
End Sub



Bob Phillips[_6_]

add method of validation failing
 
Worked fine for me.

Doesn't even use a worksheet id to throw suspicion on. What is the command
button, form or control toolbox.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"mark kubicki" wrote in message
...
and i can't figure out why...

cells in range j15: j20 contan test values 12,34,56,78...


Private Sub CommandButton1_Click()
With Range("J24")
.Borders(xlEdgeLeft).Weight = xlThin
.Borders(xlEdgeRight).Weight = xlThin
With .Validation
.Delete
.Add Type:=xlValidateList,

AlertStyle:=xlValidAlertWarning,
Operator _
:=xlBetween, Formula1:="=$j$15:$j$20"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "lit title"
.ErrorTitle = "waninng title"
.InputMessage = "input message"
.ErrorMessage = "warning messge"
.ShowInput = True
.ShowError = True
End With
End With
End Sub





Mark Kubicki

add method of validation failing
 
post youir responce, I re-created it in a macro, copied it into code, and it
worked !!!
then it didn't
the command button is just a standard command button (created thru the
toolbox) on a worksheet; I added it to test the code with...

-mark




"Bob Phillips" wrote in message
...
Worked fine for me.

Doesn't even use a worksheet id to throw suspicion on. What is the command
button, form or control toolbox.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"mark kubicki" wrote in message
...
and i can't figure out why...

cells in range j15: j20 contan test values 12,34,56,78...


Private Sub CommandButton1_Click()
With Range("J24")
.Borders(xlEdgeLeft).Weight = xlThin
.Borders(xlEdgeRight).Weight = xlThin
With .Validation
.Delete
.Add Type:=xlValidateList,

AlertStyle:=xlValidAlertWarning,
Operator _
:=xlBetween, Formula1:="=$j$15:$j$20"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "lit title"
.ErrorTitle = "waninng title"
.InputMessage = "input message"
.ErrorMessage = "warning messge"
.ShowInput = True
.ShowError = True
End With
End With
End Sub








All times are GMT +1. The time now is 10:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com