Minato5972
New Member
- Joined
- Mar 18, 2021
- Messages
- 11
- Office Version
- 2019
- 2016
Transformed(PRow * (c - 1) + 1, 29) = "=MAX(Y" & Sum + 2 & ", IF(H" & Sum & "= 99,I" & Sum & ",SUM(OFFSET(H" & Sum - 1 & ",1,12,1,-H" & Sum & "),Y" & Sum + 3 & ")/H" & Sum & ")) "
Formula is getting pushed and code is running properly
But i want to evaluate the formula and push in value. I tried,
Transformed(PRow * (c - 1) + 1, 29) = Evaluate("=MAX(Y" & Sum + 2 & ", IF(H" & Sum & "= 99,I" & Sum & ",SUM(OFFSET(H" & Sum - 1 & ",1,12,1,-H" & Sum & "),Y" & Sum + 3 & ")/H" & Sum & ")) ")
To check if it really evaluating i tried this but its not working.
Dim a as Long
a = Evaluate("=MAX(Y" & Sum + 2 & ", IF(H" & Sum & "= 99,I" & Sum & ",SUM(OFFSET(H" & Sum - 1 & ",1,12,1,-H" & Sum & "),Y" & Sum + 3 & ")/H" & Sum & ")) ")
MsgBox a
I am getting type mismatch error
Formula is getting pushed and code is running properly
But i want to evaluate the formula and push in value. I tried,
Transformed(PRow * (c - 1) + 1, 29) = Evaluate("=MAX(Y" & Sum + 2 & ", IF(H" & Sum & "= 99,I" & Sum & ",SUM(OFFSET(H" & Sum - 1 & ",1,12,1,-H" & Sum & "),Y" & Sum + 3 & ")/H" & Sum & ")) ")
To check if it really evaluating i tried this but its not working.
Dim a as Long
a = Evaluate("=MAX(Y" & Sum + 2 & ", IF(H" & Sum & "= 99,I" & Sum & ",SUM(OFFSET(H" & Sum - 1 & ",1,12,1,-H" & Sum & "),Y" & Sum + 3 & ")/H" & Sum & ")) ")
MsgBox a
I am getting type mismatch error