diminutivetasker
New Member
- Joined
- Jun 5, 2012
- Messages
- 11
Hi All,
So I'm new to VBA. I received an error: Runtime Error 91 and I'm not sure how to fix it. I'm trying to cut and paste cells into another worksheet. Any help is much appreciated, thanks.
When I go into the debugger it highlights the following line of code as incorrect:
Selection.Find(what:="TRUE", After:=ActiveCell, LookIn:=xlFormulas, _
Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Full code below:
Sub Macro3()
'
' Macro3 Macro
'
'
Columns("M:M").Select
Selection.Find(what:="FALSE", After:=ActiveCell, LookIn:=xlFormulas, _
Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Columns("A:A").EntireColumn.Select
ActiveCell.Offset(0, 1).Range("A1").Activate
Selection.Find(what:="TRUE", After:=ActiveCell, LookIn:=xlFormulas, _
Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(-12, -13).Range("A1:N13").Select
ActiveCell.Activate
Selection.Cut
Application.CutCopyMode = False
Selection.Cut
Sheets("Sheet2").Select
ActiveSheet.Paste
Selection.End(xlDown).Select
ActiveCell.Offset(2, 0).Range("A1").Select
Sheets("Sheet1").Select
End Sub
So I'm new to VBA. I received an error: Runtime Error 91 and I'm not sure how to fix it. I'm trying to cut and paste cells into another worksheet. Any help is much appreciated, thanks.
When I go into the debugger it highlights the following line of code as incorrect:
Selection.Find(what:="TRUE", After:=ActiveCell, LookIn:=xlFormulas, _
Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Full code below:
Sub Macro3()
'
' Macro3 Macro
'
'
Columns("M:M").Select
Selection.Find(what:="FALSE", After:=ActiveCell, LookIn:=xlFormulas, _
Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Columns("A:A").EntireColumn.Select
ActiveCell.Offset(0, 1).Range("A1").Activate
Selection.Find(what:="TRUE", After:=ActiveCell, LookIn:=xlFormulas, _
Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(-12, -13).Range("A1:N13").Select
ActiveCell.Activate
Selection.Cut
Application.CutCopyMode = False
Selection.Cut
Sheets("Sheet2").Select
ActiveSheet.Paste
Selection.End(xlDown).Select
ActiveCell.Offset(2, 0).Range("A1").Select
Sheets("Sheet1").Select
End Sub