View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Exit Sub if count less than zero.

Oops; please ignore the previous post....

COUNT() is a worksheet function.So ..

Sub SettleAutoDue()

If WorksheetFunction.Count(Range("T4:T53")) < 0 Then
Worksheets("A-3").Range("U4:Z4").Copy
Range("G5").PasteSpecial Paste:=xlPasteValues, Transpose:=True
Application.CutCopyMode = False
Range("G4").Activate
End If

End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


" wrote:

Need help on this.

I don't want the Macro to work if [***IF COUNT(T4:T53) = 0 THEN EXIT SUB***]
inside the Macro below.


Sub SettleAutoDue()

***IF COUNT(T4:T53) = 0 THEN EXIT SUB***

Worksheets("A-3").Range("U4:Z4").Copy
Range("G5").PasteSpecial Paste:=xlPasteValues, Transpose:=True
Application.CutCopyMode = False
Range("G4").Activate

End Sub


Thank you.