Have a 5000+ row 30 column Excel 2007 worksheet that I manually add over 75 records to each week. Each column contain unique list validations.
Current Procedure: After copy/pasting the 75 records each week, I manually copy/paste the validation down each column for each of the newly added records that is quite time consuming - especially if there is pre-existing data in a particular cell within a column.
Desired Procedure: Upon manually pasting the 75 records, automatically copy the validation in the first cell of the column down to the last row of data (for each of the 30 columns). Note, data will always exist in column A.
Is this possible?
Currently experimenting with the following, but would appreciate any insight considering that I have spent over an hour trying to resolve.
Sub CopyValidation()
'Copies cell validation from cell B1 to B2
Dim ToCell As Validation
Set ToCell = [B2].Validation
With [B1].Validation
ToCell.Add _
Type:=xlValidateList, _
AlertStyle:=.AlertStyle, _
Operator:=.Operator, _
Formula1:=.Formula1
ToCell.IgnoreBlank = .IgnoreBlank
ToCell.InCellDropdown = True
ToCell.InputMessage = .InputMessage
ToCell.ErrorMessage = .ErrorMessage
ToCell.ShowInput = .ShowInput
ToCell.ShowError = .ShowError
End With
End Sub
Current Procedure: After copy/pasting the 75 records each week, I manually copy/paste the validation down each column for each of the newly added records that is quite time consuming - especially if there is pre-existing data in a particular cell within a column.
Desired Procedure: Upon manually pasting the 75 records, automatically copy the validation in the first cell of the column down to the last row of data (for each of the 30 columns). Note, data will always exist in column A.
Is this possible?
Currently experimenting with the following, but would appreciate any insight considering that I have spent over an hour trying to resolve.
Sub CopyValidation()
'Copies cell validation from cell B1 to B2
Dim ToCell As Validation
Set ToCell = [B2].Validation
With [B1].Validation
ToCell.Add _
Type:=xlValidateList, _
AlertStyle:=.AlertStyle, _
Operator:=.Operator, _
Formula1:=.Formula1
ToCell.IgnoreBlank = .IgnoreBlank
ToCell.InCellDropdown = True
ToCell.InputMessage = .InputMessage
ToCell.ErrorMessage = .ErrorMessage
ToCell.ShowInput = .ShowInput
ToCell.ShowError = .ShowError
End With
End Sub