JARichard74
Board Regular
- Joined
- Dec 16, 2019
- Messages
- 114
- Office Version
- 365
- Platform
- Windows
Get error 1004 Application defined error
Where
Hrngel = WorksheetFunction.Average(Range("B" & startRow & ":B" & endRow)) - WorksheetFunction.StDev(Range("B" & startRow & ":B" & endRow))
Hrngeh = WorksheetFunction.Average(Range("B" & startRow & ":B" & endRow)) + WorksheetFunction.StDev(Range("B" & startRow & ":B" & endRow))
Both Dim As Double
VBA Code:
.Range(.Cells(startCell, 6), .Cells(startCell, 6)).Formula = "=(COUNTIFS(B" & startRow & ":B" & endRow & ", ""<""& " & Hrngel & ",B" & startRow & ":B" & endRow & ", "">""& " & Hrngeh & ", ""<""& B" & startCell & ")+1)"
Hrngel = WorksheetFunction.Average(Range("B" & startRow & ":B" & endRow)) - WorksheetFunction.StDev(Range("B" & startRow & ":B" & endRow))
Hrngeh = WorksheetFunction.Average(Range("B" & startRow & ":B" & endRow)) + WorksheetFunction.StDev(Range("B" & startRow & ":B" & endRow))
Both Dim As Double