LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Validating in VBA

Casey, try this:

'-----------------------------------------------------
'
'TARGET is the cell you want to add validation to
'
'LISTRANGE are the cells in column CC that contain _
the list of names that you want the TARGET _
to be limited to
'
'-----------------------------------------------------
Sub AddValidation(Target As Range, ListRange As Range)

Dim strAddress As String

strAddress = "=" & ListRange.Address
With Target.Validation
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, _
Formula1:=strAddress
.IgnoreBlank = True
.InCellDropdown = True
.ShowInput = True
.ShowError = True
End With

End Sub

 
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
validating Philashley Excel Discussion (Misc queries) 2 March 13th 08 03:54 PM
validating outside of Excel BorisS Excel Discussion (Misc queries) 0 February 22nd 07 04:12 PM
validating Ayesha Excel Worksheet Functions 2 April 26th 06 02:56 PM
Validating Sdbenn90 Excel Discussion (Misc queries) 0 March 27th 06 12:05 AM
Validating Dates Luis Verme Excel Programming 22 July 10th 05 11:41 AM


All times are GMT +1. The time now is 11:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"