PC Review


Reply
Thread Tools Rate Thread

change InputTitle and InputMessage in columns from row 2 thru 1000

 
 
John L
Guest
Posts: n/a
 
      15th Oct 2009
Hello,

I have 60 columns and 1000 rows with column title in row 1.

How would I adapt the following code to specify a different InputMessage
(IM) and InputTitle (IT) for each column row2 to 1000? Each cell in the
column (except row 1) has the same IT and IM. Or, does it need totally
separate code?

Specifically, is there a way to do it without writing 60 blocks of code?
Perhaps by specifying a cell range for IT and IM on another sheet? There are
columns not specified in the ranges below because they are not yes/no.

Thanks in advance,
John

Sub YESNOValidate()

Dim Choices As String
Choices = "Yes, No"

Dim r1 As Range, r2 As Range, r3 As Range, r4 As Range, r5 As Range, r6
As Range, r7 As Range, myMultiAreaRange As Range
Worksheets("Data entry sheet").Activate
Set r1 = Range("F2:L1000")
Set r2 = Range("N2:T1000")
Set r3 = Range("W2:AE1000")
Set r4 = Range("AH2:AJ1000")
Set r5 = Range("AL2:AS1000")
Set r6 = Range("AU2:AX1000")
Set r7 = Range("AZ2:BH1000")
Set myMultiAreaRange = Union(r1, r2, r3, r4, r5, r6, r7)
myMultiAreaRange.Select


With Selection.Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=Choices
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "IT"
.ErrorTitle = "ET"
.InputMessage = "IM"
.ErrorMessage = "Please Input Yes or No, case sensitive"
.ShowInput = True
.ShowError = True
End With
End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
InputTitle and InputMessage for a column in combo box drop down John L Microsoft Excel Programming 1 19th Oct 2009 06:08 PM
Change number of Columns from a max of 255 to 1000 =?Utf-8?B?UGV0ZQ==?= Microsoft Access 4 15th Feb 2007 03:56 PM
For i = 5 to 1000 for columns? daniroy@gmail.com Microsoft Excel Programming 4 31st Jul 2006 11:49 AM
Validation inputmessage multilines itarnak Microsoft Excel Programming 3 13th Oct 2005 02:54 PM
1000 pts datagrid to excel with columns readonly Luis Esteban Valencia Microsoft ASP .NET 1 7th Jan 2005 05:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:20 AM.