SQUIDD
Well-known Member
- Joined
- Jan 2, 2009
- Messages
- 2,104
- Office Version
- 2019
- 2016
- Platform
- Windows
Hi
I have a line of code, but sometimes when i have zeros, it gives me a "divide by zero error"
so, when i do this as a formula i use iferror(formula,"")
so my question is, can i wrap this code in an iferror sttatment in vba
thanks in advance
i did try application.iferror
dave
I have a line of code, but sometimes when i have zeros, it gives me a "divide by zero error"
so, when i do this as a formula i use iferror(formula,"")
so my question is, can i wrap this code in an iferror sttatment in vba
Code:
result = 100 / Application.CountIf(Sheets("TRAP" & a - 1).Range("C:C"), a - 1) * Application.WorksheetFunction.CountIfs(Sheets("TRAP" & a - 1).Range("C:C"), a - 1, Sheets("TRAP" & a - 1).Range("E:E"), 1)
thanks in advance
i did try application.iferror
dave