Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Dylan Bouchard   on Oct 05 In MS Office Category.

  
Question Answered By: Lewis Welch   on Oct 05

Why not run a check BEFORE you start your loop?
Check to see if there are any negatives in your range. If so, you stop the
loop from making any changes thus you won't have to undo  anything. As an added
bonus, it will save running time on your macro.

Sub NegCheck()
ColumnMin = Application.WorksheetFunction.Min(Range("A1:C65536"))
If ColumnMin < 0 Then Exit Sub
End Sub

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on undo changes Or get search suggestion and latest updates.


Tagged: