Hi everybody!
After a while I'm still not into VBA, please, I need to check some range, if it's sum is greater then zero then run code normal, if it's equal zero then skip bunch of code to Exit Sub.
This is the beginning of code, where to insert if statement?
Thanks so much !
After a while I'm still not into VBA, please, I need to check some range, if it's sum is greater then zero then run code normal, if it's equal zero then skip bunch of code to Exit Sub.
Code:
Sub Macro1_OCISTI_PODATKE_SA_IZVJESTAJA()
'
' Macro1_OCISTI_PODATKE_SA_IZVJESTAJA Macro
'
'
Dim MSG As String, ANS As Variant
MSG = " SIGURNO ŽELITE OČISTITI PODATKE ?"
ANS = MsgBox(MSG, vbExclamation + vbOKCancel + vbDefaultButton2, "UPOZORENJE !!!")
Select Case ANS
Case vbOK
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
On Error GoTo GRESKA2
Sheets("Izvještaj_SVE").Select
Columns("B:B").Select
'Ovaj kod kopira izvješće na Izvještaj_SVE list.
Dim R As Long
If WorksheetFunction.CountA(Cells(2, 2).EntireColumn) > 18241 Then
Rows("18242:18242").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Rows("2:48").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A2").Select
This is the beginning of code, where to insert if statement?
Thanks so much !