M
MichaelC
I have the following code in my macro but get a RunTime error 1004 where
indicated.
I would much appreciate guidance on how to rectify this. Thanks in advance.
Sub Test()
Dim RowValue As Integer
Dim ColumnValue As Integer
Dim TradeAttribute As Integer
'ActiveCell is on Sheets("Control")
RowValue = ActiveCell.Row
ColumnValue = ActiveCell.Column
TradeAttribute = Sheets("Control").Cells(11, ColumnValue)
'When I run the macro I get Run Time error 1004:Select method of Range Class
failed
' and the line of code below is highlighted.
Sheets("Detail").Range("VarInput").Offset((RowValue - 12) * 500,
TradeAttribute).Select
'I want to select a range of 497 cells below the cell selected on
Sheets("Detail") for deletion
Range("A1:A497").Select
Selection.ClearContents
End Sub
indicated.
I would much appreciate guidance on how to rectify this. Thanks in advance.
Sub Test()
Dim RowValue As Integer
Dim ColumnValue As Integer
Dim TradeAttribute As Integer
'ActiveCell is on Sheets("Control")
RowValue = ActiveCell.Row
ColumnValue = ActiveCell.Column
TradeAttribute = Sheets("Control").Cells(11, ColumnValue)
'When I run the macro I get Run Time error 1004:Select method of Range Class
failed
' and the line of code below is highlighted.
Sheets("Detail").Range("VarInput").Offset((RowValue - 12) * 500,
TradeAttribute).Select
'I want to select a range of 497 cells below the cell selected on
Sheets("Detail") for deletion
Range("A1:A497").Select
Selection.ClearContents
End Sub