Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here are the formulas... one is from source file that was given to me, the other is the formula copied over:
- =IF(AND($V2>0, OR($W2<>0,$X2<>0,$R2<>0,$S2<>0)),IF((ABS($W2)+ABS($R2))<>0, ((ABS((ABS($W2)+ABS($R2))*((ABS($I2)+ABS($L2)+ABS($T2))/(ABS($G2)+ABS($J2)+ABS($R2))))*_junkRate)+$X2)/$V2, $X2/$V2),IF((ABS($W2)+ABS($R2))<>0, ((ABS((ABS($W2)+ABS($R2))*((ABS($I2)+ABS($L2)+ABS($T2))/(ABS($G2)+ABS($J2)+ABS($R2))))*_junkRate)+$X2)/ABS(ABS($W2)+ABS($R2)), 0))
- =IF(AND($V2>0, OR($W2<>0,$X2<>0,$R2<>0,$S2<>0)),IF((ABS($W2)+ABS($R2))<>0, ((ABS((ABS($W2)+ABS($R2))*((ABS($I2)+ABS($L2)+ABS($T2))/(ABS($G2)+ABS($J2)+ABS($R2))))*_junkRate)+$X2)/$V2, $X2/$V2),IF((ABS($W2)+ABS($R2))<>0, ((ABS((ABS($W2)+ABS($R2))*((ABS($I2)+ABS($L2)+ABS($T2))/(ABS($G2)+ABS($J2)+ABS($R2))))*_junkRate)+$X2)/ABS(ABS($W2)+ABS($R2)), 0))
- The lines of code that do all the copying over in VBA are :
- 'populate margin analyisis report data
- wb.Sheets(JUNKSHEET).Range("A1:T" & junkEnd).Value = junk.Range("A1:T" & junkEnd).Value
- junk.Range("V1:Y" & junkEnd).Copy
- wb.Sheets(JUNKSHEET).Range("V1:Y" & junkEnd).PasteSpecial xlPasteFormulas
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement