I am a pretty inexperienced user of VBA but hoping someone can help... Why would I bet getting a "Loop without Do" error on the following code?
*********************
Sub OverUnder()
Sheets("Weekly Input Sheet").Range("B4").Select
CurrWkNum = ActiveCell.Value
Sheets("Sample File").Select
Do While Error = False
ActiveSheet.Next.Select
CurrSheetName = ActiveSheet.Name
Columns("E:E").Select
Selection.Find(What:=CurrWkNum, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 5).Select
If ActiveCell.Value > 0 Then
Range(Selection, ActiveCell.Offset(0, 3)).Select
Selection.Copy
Sheets("Profitability Dashboard").Select
Cells.Select
Selection.Find(What:="Which are over and by what %", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets(CurrSheetName).Select
Range("A5").Select
Range(Selection, ActiveCell.Offset(0, 3)).Select
Selection.Copy
Sheets("Profitability Dashboard").Select
Cells.Select
Selection.Find(What:="Which are over and by what %", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(xlDown).Select
ActiveCell.Offset(0, -2).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets(CurrSheetName).Select
Else
Loop
End Sub
****************
thanks in advance for the help!!!
*********************
Sub OverUnder()
Sheets("Weekly Input Sheet").Range("B4").Select
CurrWkNum = ActiveCell.Value
Sheets("Sample File").Select
Do While Error = False
ActiveSheet.Next.Select
CurrSheetName = ActiveSheet.Name
Columns("E:E").Select
Selection.Find(What:=CurrWkNum, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 5).Select
If ActiveCell.Value > 0 Then
Range(Selection, ActiveCell.Offset(0, 3)).Select
Selection.Copy
Sheets("Profitability Dashboard").Select
Cells.Select
Selection.Find(What:="Which are over and by what %", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets(CurrSheetName).Select
Range("A5").Select
Range(Selection, ActiveCell.Offset(0, 3)).Select
Selection.Copy
Sheets("Profitability Dashboard").Select
Cells.Select
Selection.Find(What:="Which are over and by what %", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(xlDown).Select
ActiveCell.Offset(0, -2).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets(CurrSheetName).Select
Else
Loop
End Sub
****************
thanks in advance for the help!!!