如何在word excel中10*10的格子随即生成1-100的自然数且不重复,或者你做好了直接发给我也可以,我要5份

\u5982\u4f55\u5728Excel\u886810\u00d710\u65b9\u683c\u5185\u81ea\u52a8\u968f\u673a\u751f\u62101-100\u81ea\u7136\u6570

\u8f93\u5165:"=int(rand()*100+1)"
\u968f\u673a\u751f\u6210\u7684\u6570\u5c31\u53ef\u80fd\u6709\u91cd\u590d.
\u968f\u673a\u6392\u5217\u662f\u53ef\u4ee5\u7684.
\u63d0\u4f9b\u4ee5\u4e0b\u65b9\u6cd5\u770b\u4f60\u80fd\u5426\u63a5\u53d7:
\u8bf7\u6309\u6b65\u9aa4\u64cd\u4f5c:
1. \u6253\u5f00\u63a7\u5236\u5de5\u5177\u7bb1. \u4f4d\u7f6e"\u83dc\u5355"->"\u68c0\u89c6"->"\u5de5\u5177\u5217"->"\u63a7\u5236\u5de5\u5177\u7bb1"
2. \u5728"\u63a7\u5236\u5de5\u5177\u7bb1"\u70b9\u53d6"\u6307\u4ee4\u6309\u94ae"
3. \u5728Excel\u7684\u9002\u5f53\u4f4d\u7f6e\u753b\u4e00\u6309\u94ae
4. \u53cc\u6fc0\u6309\u94ae,\u8fdb\u5165\u4ee3\u7801\u7f16\u8f91,\u5728Private Sub CommandButton1_Click()\u4e0eEnd Sub\u4e4b\u95f4\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9:
Private Sub CommandButton1_Click() '\u6ce8\u610f\u4e0d\u8981\u91cd\u590d
Dim a As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim l As Integer

For i = 0 To 9
For j = 0 To 9

Loop1:
a = Int(Rnd() * 100 + 1)

For k = 0 To 9
For l = 0 To 9
If k = i And l = j Then GoTo Loop2
If Cells(Selection.Row + k, Selection.Column + l) = a Then GoTo Loop1
Next l, k

Loop2:
Cells(Selection.Row + i, Selection.Column + j) = a

Next j, i
End Sub '\u6ce8\u610f\u4e0d\u8981\u91cd\u590d

5. \u70b9\u6fc0"\u63a7\u5236\u5de5\u5177\u7bb1"\u7684\u7b2c\u4e00\u4e2a\u6309\u94ae(\u56fe\u6807\u4e3a\u4e09\u89d2\u677f\u548c\u94c5\u7b14),\u7ed3\u675f\u8bbe\u8ba1\u6a21\u5f0f
6. \u5c06\u8981\u4ea7\u751f\u6570\u636e\u768410X10\u533a\u57df\u7684\u5de6\u4e0a\u65b9\u7684\u7b2c\u4e00\u4e2a\u5355\u5143\u683c\u9009\u4e2d
7. \u70b9\u521a\u624d\u521b\u5efa\u7684\u6309\u94ae.10X10\u7684\u683c\u5b50\u4e2d\u5c31\u968f\u673a\u4ea7\u751f\u4e86\u4f60\u6240\u8981\u7684\u6570\u636e.

Sub try1()
For i = 1 To 10
For j = 1 To 10
Randomize
myvalue1 = Int(9 * Rnd) + 1

Randomize
myvalue2 = Int(10 * Rnd)

Do While myvalue2 = myvalue1
Randomize
myvalue2 = Int(10 * Rnd)
Loop

Randomize
myvalue3 = Int(10 * Rnd)
Do While myvalue2 = myvalue3
Randomize
myvalue3 = Int(10 * Rnd)
Loop
Cells(i, j) = myvalue1 * 100 + myvalue2 * 10 + myvalue3
Next j
Next i

用EXCEL方法:
1、在L列生成100个随机数,在L1用公式:

=RAND()

下拉到L100;

 

2、在A1:J100生成10*10数据,在A1用公式:

=MATCH(SMALL($L$1:$L$100,ROW(A1)+10*COLUMN(A1)-10),$L$1:$L$100,0)

右拉到J1,下拉10行。

 

3、按一次F9键生成一组。



怎么发给你

扩展阅读:word在线编辑 ... 提取word内容到excel ... 用excel自动生成word ... 把word内容填到excel ... word excel ppt统称为 ... excel转word排版不变 ... excel表一键导入word ... word excel零基础入门教程 ... 手机如何在方框内打v ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网