使用VBA更新Excel中的库存水平 [英] Update the stock level in Excel with VBA

查看:102
本文介绍了使用VBA更新Excel中的库存水平的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个包含2个工作表,产品和订单的电子表格.我也有一张新订单的表格.基本上,我希望在下订单时更新产品页面上的库存水平.即使您不能在编码方面提供帮助,我也很想知道您认为我应该如何解决我遇到的问题.

谢谢

Hi,
I have a spreadsheet with 2 worksheets, products and orders. I also have a form for new orders. Basically I want the stock level on the products page to be updated when the order is placed. Even if you can''t help with the coding side I would be interested to know how you think I should go about solving the problem I have.

Thanks

推荐答案

IMO,最简单的方法是在电子表格中命名特定范围.

例如,如果您有下表:

桌子>

我将命名为15的单元格命名为"ShampooStock",命名为13的单元格命名为"SoapStock".

然后,无论何时下订单,您都可以访问工作表和命名范围,例如:

IMO, the easiest way would be to name the specific ranges in the spreadsheet.

For example, if you had the following table:

产品 库存
洗发水 15
肥皂 13
ProductStock
Shampoo15
Soap13


I would name the cell with the number 15 in it something like "ShampooStock" and the cell with the number 13 in it something like "SoapStock".

Then, whenever an order is placed, you access the sheet and the named range like:

Worksheets("Products").Range("ShampooStock") = Worksheets("Products").Range("ShampooStock") - NumberOrdered


这篇关于使用VBA更新Excel中的库存水平的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆