Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA and validation list
Hi,
I have a validation list (H1:H5), I hope, using VBA, the list can automatically attach itself to any cell in the first column of the worksheet when the cell gets input focus. How can I do this? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA and validation list
Why not just select column a and apply Data=Validation.
-- Regards, Tom Ogilvy "John" wrote: Hi, I have a validation list (H1:H5), I hope, using VBA, the list can automatically attach itself to any cell in the first column of the worksheet when the cell gets input focus. How can I do this? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA and validation list
Thank you very much.
"Tom Ogilvy" wrote: Why not just select column a and apply Data=Validation. -- Regards, Tom Ogilvy "John" wrote: Hi, I have a validation list (H1:H5), I hope, using VBA, the list can automatically attach itself to any cell in the first column of the worksheet when the cell gets input focus. How can I do this? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA and validation list
Paste this code into the specific Sheet module you want this to happen
on: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Application.Intersect(Target, Columns(1)) Is Nothing Then With Target.Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="=TheGuys" 'This refers to an existing Named Range .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With End If End Sub Worked for me... Jim May "John" wrote in message : Hi, I have a validation list (H1:H5), I hope, using VBA, the list can automatically attach itself to any cell in the first column of the worksheet when the cell gets input focus. How can I do this? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
data validation invalid in dynamic validation list | Excel Discussion (Misc queries) | |||
data validation invalid in dynamic validation list | Excel Worksheet Functions | |||
Validation (Drop down list vs simple text length validation) | Excel Programming | |||
Validation (Drop down list vs simple text length validation) | Excel Programming | |||
Validation (Drop down list vs simple text length validation) | Excel Programming |