szita2000
Board Regular
- Joined
- Apr 25, 2012
- Messages
- 101
- Office Version
- 365
- Platform
- Windows
Hi All.
This is a bit of mystery.
In a macro I place Data validation Dropdown in to a range.
I am using this bit of code for this:
When I run the macro for the first time. It places the dropdowns O.K.
If I clear everything and rerun the macro the second time I do not have dropdowns in the cells.
The things I checked:
Wonder if I should get rid of the .delete in the listrange.Validation?...
Let me know if you want to see the rest of the code.
Thanks
This is a bit of mystery.
In a macro I place Data validation Dropdown in to a range.
I am using this bit of code for this:
VBA Code:
'Adding the Data validation listboxes to ***listrange***
With listrange.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=rngTipus"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
When I run the macro for the first time. It places the dropdowns O.K.
If I clear everything and rerun the macro the second time I do not have dropdowns in the cells.
The things I checked:
- I put ActiveX buttons on the sheet at the same time (actually before this snippet goes) - They don't seem to be taking focus
- I checked if Application.EnableEvents is TRUE- It is
- I checked Application.ScreenUpdating is TRUE - It is
- I commented out all Screenupdating and manual calculation from the code
Wonder if I should get rid of the .delete in the listrange.Validation?...
Let me know if you want to see the rest of the code.
Thanks