S
Squeaky
I have a macro that works fine in my workbook, yet when I go into VBA and try
to run it there (using F5 or stepping into it with F8 I get the error. All of
the other macros in theis workbook work fine from VBA.
Any ideas?
Here is the macro:
Sub Line()
'
' Line Macro
'
ActiveSheet.Unprotect Password:=""
If Intersect(ActiveCell, Range("range1")) Is Nothing Then
Range("RANGE1.1").Select
Do
If IsEmpty(ActiveCell) = True Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = False
ActiveCell.Offset(-1, 1).Select
ActualRow = Selection.Row
Cells(ActualRow + 1, 1).EntireRow.Insert
Range(Cells(ActualRow, 1), Cells(ActualRow, 33)).Copy _
Destination:=Cells(ActualRow + 1, 1)
Else
ActualRow = Selection.Row
Cells(ActualRow + 1, 1).EntireRow.Insert
Range(Cells(ActualRow, 1), Cells(ActualRow, 33)).Copy _
Destination:=Cells(ActualRow + 1, 1)
End If
ActiveSheet.Protect Password:="", DrawingObjects:=True, Contents:=True,
Scenarios:=True
Range("RANGE1.1").Select
End Sub
to run it there (using F5 or stepping into it with F8 I get the error. All of
the other macros in theis workbook work fine from VBA.
Any ideas?
Here is the macro:
Sub Line()
'
' Line Macro
'
ActiveSheet.Unprotect Password:=""
If Intersect(ActiveCell, Range("range1")) Is Nothing Then
Range("RANGE1.1").Select
Do
If IsEmpty(ActiveCell) = True Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = False
ActiveCell.Offset(-1, 1).Select
ActualRow = Selection.Row
Cells(ActualRow + 1, 1).EntireRow.Insert
Range(Cells(ActualRow, 1), Cells(ActualRow, 33)).Copy _
Destination:=Cells(ActualRow + 1, 1)
Else
ActualRow = Selection.Row
Cells(ActualRow + 1, 1).EntireRow.Insert
Range(Cells(ActualRow, 1), Cells(ActualRow, 33)).Copy _
Destination:=Cells(ActualRow + 1, 1)
End If
ActiveSheet.Protect Password:="", DrawingObjects:=True, Contents:=True,
Scenarios:=True
Range("RANGE1.1").Select
End Sub