简体   繁体   English

VBA 动态行作为基于文本的范围

[英]VBA Dynamic Rows as Range based on text

Days Stock Covers falls on various rows per SKU.天库存覆盖落在每个 SKU 的不同行上。 How do I come up with a looping formula that finds the text (Days Stock Cover) and inserts my calculation in that row?我如何想出一个循环公式来查找文本(Days Stock Cover)并在该行中插入我的计算?

Sub Calc_DoC()    
    Range("C6:N6").Formula = "=(C5/average(c2:e2))*30"
End Sub

The method I would recommend is applying a filter to the data set, filtering on "Days Stock Cover", and then using the formula you posted on only the visible cells.我推荐的方法是对数据集应用过滤器,过滤“Days Stock Cover”,然后使用您仅在可见单元格上发布的公式。

Try to write up that code yourself and I am happy to help on the places you get stuck.尝试自己编写该代码,我很乐意在您遇到困难的地方提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM