A
ADK
Using Excel 2000:
I get a runtime error '1004' PasteSpecial method of Range class failed
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
Here is code:
Sub addrow()
Dim CellOne As Range
Set CellOne = ActiveCell
If CellOne.Value = 1 Then
MsgBox "You can not insert a row above Number 1", 64, "Invalid"
Exit Sub
End If
Range("A" & ActiveCell.Row).Select
ActiveCell.EntireRow.Insert
ActiveCell.Offset(-1, 0).Select
Cells(ActiveCell.Row + 1, ActiveCell.Column).Select
Selection.FillDown
ActiveCell.Offset(-1, 2).Select
Selection.Copy
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
End Sub
I get a runtime error '1004' PasteSpecial method of Range class failed
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
Here is code:
Sub addrow()
Dim CellOne As Range
Set CellOne = ActiveCell
If CellOne.Value = 1 Then
MsgBox "You can not insert a row above Number 1", 64, "Invalid"
Exit Sub
End If
Range("A" & ActiveCell.Row).Select
ActiveCell.EntireRow.Insert
ActiveCell.Offset(-1, 0).Select
Cells(ActiveCell.Row + 1, ActiveCell.Column).Select
Selection.FillDown
ActiveCell.Offset(-1, 2).Select
Selection.Copy
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlDataValidation, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
End Sub