Now I have macro as below.
But after run , it show error Application-defined or object-defined error in line Cells(2, 6).Resize(UBound(a)) = aPlease Login or Register to view this content.
Please guide me about it.
Now I have macro as below.
But after run , it show error Application-defined or object-defined error in line Cells(2, 6).Resize(UBound(a)) = aPlease Login or Register to view this content.
Please guide me about it.
Not sure what you want to do, but the error is because you assign Cells(2,6).Resize(Ubound(a)) to a.
If you change that line to a = Cells(2,6).Resize(Ubound(a)), the error will disappear, but not sure that the code will work as what you want or not.
I want to calculate value by column FPP divide value column Case.
I've revised your code as below:
Please Login or Register to view this content.
I want output show number after cal only.
Now Show formula in tab function.
Please guide me more about it.
You can change a.Cells(i, 6).FormulaR1C1 = "=RC[-1]/RC[-2]" to a.Cells(i, 6) = a.Cells(i, 5) / a.Cells(i, 4) in order to get a static value.
This code may cause slowness on large data (50k rows+) due to the loop that inputs a value directly on each cell.
Please Login or Register to view this content.
This one is the faster version if your data size is large:
Please Login or Register to view this content.
Why do you need a code for this simple task which could be done by a formula?
Please Login or Register to view this content.
After run your code , I found error overflow in line vFYP(i, 1) = vFPP(i, 1) / vCase(i, 1)
I think some value in vFPP and vCase = oPlease Login or Register to view this content.
How to solve it?
Last edited by adamasmay; 03-20-2022 at 10:20 AM.
It is due to bottom has zero or error value. Have you tried my code?
OR your codePlease Login or Register to view this content.
Please Login or Register to view this content.
Hi adamasmay,
It is dividing by zero error, please amend as below
Please Login or Register to view this content.
Please Login or Register to view this content.
Please Login or Register to view this content.
Last edited by jindon; 03-20-2022 at 11:55 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks