I want to calculate value by column FPP divide value column Case.
Please guide me about it.
I want to calculate value by column FPP divide value column Case.
Please guide me about it.
Not sure I fully understand what you want, but maybe...
=E2/D2
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Yes =E2/D2
Please guide me about it.
At column 2, row 2, Type =, column5 row2, / , column 4 row 2 , then you will see the formula =RC[-1]/RC[-2]
And you can copy this formula down to other rows.
Or, just copy my formula where you need it to be, then copy down as needed
If I want use code VBA.
How to edit it ?
why would you want to use VBA on something so simple?
VBA solution:
PHP Code:
Option Explicit
Sub test()
Dim Lr&, k&, arr(), cell As Range
Lr = Cells(Rows.Count, "E").End(xlUp).Row
ReDim arr(1 To Lr - 1, 1 To 1)
For Each cell In Range("E2:E" & Lr)
k = k + 1
If cell.Offset(0, -1).Value <> 0 Then arr(k, 1) = cell / cell.Offset(0, -1).Value
Next
Range("F2").Resize(k, 1).Value = arr
End Sub
Quang PT
According to the attachment a VBA demonstration for starters :
PHP Code:
Sub Demo1()
Application.ReferenceStyle = xlA1
With Range("F2:F" & [A1].CurrentRegion.Rows.Count)
.NumberFormat = "#,##0.00_-"
.Value2 = Evaluate(Replace("IF(D2:D#<>0,E2:E#/D2:D#,"""")", "#", .Rows.Count + 1))
End With
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
Last edited by Marc L; 03-21-2022 at 05:53 AM. Reason: adding columns style …
Hi Mr Marc L
Just To know
Why not
Please Login or Register to view this content.
Hi mohadin,
just 'cause I wrote .Value2 rather than .Formula according to the attachment without any formula …
I edited my post #9 demonstration for the columns style …
Thank you for the reply
But mohadin if the formulas are necessary your way is the best as it works whatever the columns style !
Many Thanks Mr Marc L
Best regards for here
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks