这是什么意思?它会做什么? [英] What does this mean? What will it do?
问题描述
子收据()
Dim N As String
Dim D As Date
Dim Q As整数
Dim P As Currency
Dim TC as Currency
Dim Disc As String
Q =范围(C4)。值
P =范围(C5)。值
TC = Q * P
Cells(7,3).Value = TC
如果P> 100然后
细胞(8,3).Value =下次再带回20%优惠!
其他:细胞(8,3).Value = 下次再退还10%!
结束如果
End Sub
我尝试了什么:
我只是想了解这些东西是如何运作的。这将做什么?
Sub Receipt()
Dim N As String
Dim D As Date
Dim Q As Integer
Dim P As Currency
Dim TC As Currency
Dim Disc As String
Q = Range("C4").Value
P = Range("C5").Value
TC = Q * P
Cells(7, 3).Value = TC
If P > 100 Then
Cells(8, 3).Value = "Bring this back next time for 20% off!"
Else: Cells(8, 3).Value = "Bring this back next time for 10% off!"
End If
End Sub
What I have tried:
I am just wanting to understand how this stuff works more. What will this do?
推荐答案
它从两个特定单元格中读取两个值,并将它们相乘。
它将结果存储在一个第三个单元格,并检查下次允许客户有多大的折扣。这是显示在第四个单元格中。
老实说,如果你不能解决这个问题,你需要去拿一本关于这些东西的书并阅读它涵盖了 - 这是非常非常基本的东西!
It reads two values from two particular cells, and multiplies them together.
It stores the result in a third cell, and check to see how big a discount the customer is allowed next time. That is displayed in a fourth cell.
To be honest, if you can't work that out, you need to go and get a book on this stuff and read it cover to cover - that is very, very basic stuff!
这篇关于这是什么意思?它会做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!