Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default 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
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
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Validation (Drop down list vs simple text length validation) Bob Phillips[_6_] Excel Programming 2 April 27th 04 07:47 PM
Validation (Drop down list vs simple text length validation) Jason Morin[_2_] Excel Programming 1 April 27th 04 04:56 PM
Validation (Drop down list vs simple text length validation) Pete McCosh Excel Programming 0 April 27th 04 03:49 PM


All times are GMT +1. The time now is 09:43 PM.

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"