Sub mytest()
'9-1
Range("Sheet1!A1:A1000").Formula = "=randbetween(1,100)"
Range("Sheet1!A1:A1000").Copy
Range("Sheet1!A1").PasteSpecial xlPasteValues
'9-2
Range("Sheet1!A1:A1000").Copy Range("Sheet2!A1")
Range("Sheet2!A1:A1000").Sort key1:=Range("Sheet2!A1"), _
order1:=xlAscending
'9-3
Range("Sheet2!A1:A1000").Copy Range("Sheet3!A1")
n = 1
For i = 1 To 999
If Sheets("Sheet3").Cells(n, 1) = Sheets("Sheet3").Cells(n + 1, 1) Then
Sheets("Sheet3").Cells(n, 1).Delete shift:=xlUp
Else: n = n + 1
End If
Next i
'9-4
Range("Sheet3!B1:B100").FormulaArray = "=frequency(Sheet2!A1:A1000,Sheet3!A1:A100)"
Range("Sheet3!C1:C100").FormulaR1C1 = "=RC[-1]/1000"
End Sub
工作表中的:
ActiveSheet.Shapes(1).TextFrame2.TextRange.Characters.Text = "文字"窗体中的:
userform1.textbox1.text="文字"欢迎分享,转载请注明来源:内存溢出
评论列表(0条)