这是关于批处理的另一个问题:这是如何工作的? [英] Here is another question about batching: how does this work?

查看:87
本文介绍了这是关于批处理的另一个问题:这是如何工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sub ClueBatch()

Dim name As String
Dim room As String
Dim weapon As String
Dim myrow As Integer

Cells(1, 1).Activate
myrow = 1


Do Until IsEmpty(ActiveCell)
DoEvents
name = ActiveCell.Value
room = ActiveCell.Offset(1, 0).Value
weapon = ActiveCell.Offset(2, 0).Value
Cells(myrow, 3).Value = name & "in the" & room & " with the " & weapon & "."

 ActiveCell.End(xlDown).End(xlDown).Activate
 
myrow = myrow + 1

Select Case weapon

Case Is = "Candlestick"
  Range("F2").Value = Range("F2").Value + 1
Case Is = "Dagger"
  Range("F3").Value = Range("F3").Value + 1
Case Is = "Lead Pipe"
  Range("F4").Value = Range("F4").Value + 1
Case Is = "Revolver"
  Range("F5").Value = Range("F5").Value + 1
Case Is = "Rope"
  Range("F6").Value = Range("F6").Value + 1
Case Is = "Wrench"
  Range("F7").Value = Range("F7").Value + 1
End Select

Loop

Range("F2:F7").Select
Range("G2").Value = Range("F2") / WorksheetFunction.Sum(Selection)
Range("G3").Value = Range("F3") / WorksheetFunction.Sum(Selection)
Range("G4").Value = Range("F4") / WorksheetFunction.Sum(Selection)
Range("G5").Value = Range("F5") / WorksheetFunction.Sum(Selection)
Range("G6").Value = Range("F6") / WorksheetFunction.Sum(Selection)
Range("G7").Value = Range("F7") / WorksheetFunction.Sum(Selection)
Range("E10").Value = WorksheetFunction.Min(Selection)



End Sub





我尝试过的事情:



我只是想了解每件事情是如何运作的。这些函数意味着什么?



What I have tried:

I just want to understand how each thing works in this. What do the functions mean?

推荐答案

结合您的其他问题:这是什么意思?它会做什么? [ ^ ]

我们无法向您解释您的家庭作业的每一个细节:去阅读您的课程笔记,获取一本书并阅读它,无论如何。你需要学习基础知识,但你显然没有。

我们不在这里做你的作业:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



所以自己尝试一下,你可能会发现它是并不像你想象的那么困难!



如果您遇到特定问题,请询问相关问题,我们会尽力提供帮助。但我们不打算为你做这一切!
In conjunction with your other question: What does this mean? What will it do?[^]
We can't explain every last detail of your homework to you: go and read your course notes, get a book and read it, whatever. You need to learn the basics and you clearly haven't.
We arent here to do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

So try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


这篇关于这是关于批处理的另一个问题:这是如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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