ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with VBA Input Validation (https://www.excelbanter.com/excel-programming/321522-help-vba-input-validation.html)

Jim[_56_]

Help with VBA Input Validation
 
Hi all,

I'm trying to get program a cell's input validation through vba.
Specifically, I want .InputMessage to equal a variable, so I need
something like this:

dim FOO as string
foo = "Yo"

With Selection.Validation
....
..InputMessage = FOO
....
....
End with

This code does not work. Any ideas? Thanks in advance...

Jim


Harald Staff

Help with VBA Input Validation
 
The code you posted works great as is, did you try it while a cell with an
existing validation was selected ?

HTH. Best wishes Harald

"Jim" skrev i melding
oups.com...
Hi all,

I'm trying to get program a cell's input validation through vba.
Specifically, I want .InputMessage to equal a variable, so I need
something like this:

dim FOO as string
foo = "Yo"

With Selection.Validation
...
.InputMessage = FOO
...
...
End with

This code does not work. Any ideas? Thanks in advance...

Jim





All times are GMT +1. The time now is 08:00 AM.

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