寻找到这一段时间之后,我想我会分享结束了,我的工作是赎罪:
Dim k As Single 'Total Move Count
Dim x As Single 'Starting point of spiral
Dim bool As Boolean 'Boolean for direction change
bool = True 'starts boolean as true
k = 1 'starts count at 1
x = 0 ' starts position as 0
Dim i As Single
i = 1
Dim j As Single
j = 1
Do While x <= 10
For n = 0 To k
If bool = True Then
ActiveCell.Value = "=randbetween(0,100)"
ActiveCell.Offset(0, 1).Select 'Move Right
i = i + 1
Else
ActiveCell.Value = "=randbetween(100,200)"
ActiveCell.Offset(0, -1).Select 'Move Left
i = i - 1
End If
Next n
For n = 0 To k
If bool = True Then
ActiveCell.Value = "=randbetween(200,300)"
ActiveCell.Offset(1, 0).Select 'Down
i = i + 1
ActiveCell.Value = "=randbetween(300,400)"
ActiveCell.Offset(-1, 0).Select 'Up
i = i - 1
End If
Next n
k = k + 1
bool = Not bool
'MsgBox bool
x = x + 1
Loop
我希望这可以帮助别人!
欢迎来到SO!看来你误解了这个网站的全部内容。请花点时间阅读[问],然后在问这里之前浏览[help/on-topic]所需的所有知识。 –
呃哦,我可能错过了一些东西,谢谢你让我知道什么是错误的,因为这是我第一次发布到网站。我读了如何问,我想知道如果我违反了规则:你的答案与问题一起提供,你期待更多的答案:“我用______为______,你用什么?” – Dasheno
或者这是错误的堆栈交换站点(我打算把它放在excel VBA子站点中)。或者,我可能会把这个问题放在如何解决的问题上。或者是这个问题已经提出,我刚刚找不正确?感谢您花时间帮助我了解如何改善与本网站的互动,并为我缺乏经验而道歉。 – Dasheno