| ²é¿´: 685 | »Ø¸´: 2 | ||
gemjzhͳæ (³õÈëÎÄ̳)
|
[ÇóÖú]
VB ´úÂëÇó¸üÕý£¡ ÒÑÓÐ1È˲ÎÓë
|
|
Çë½Ì¸÷λһÏ£¬ÎÒдÁËÒ»¶Î´úÂ룬ÊÇÒªÉú³ÉËæ»úÊý£¬²¢½«Ïà¹ØÐÅÏ¢ÖðÐÐдÈëEXCELÖУ¬µ«ÊÇÔËÐÐʱ×ÜÊÇдÈëexcelµÚÒ»ÐУ¨Ã¿´Î¶¼Êǽ«µÚÒ»ÐÐÄÚÈݸ²¸Çµô£©£¬´úÂëÈçÏ£¬Çë°ïæÐÞ¸Äһϣ¬ÊµÏÖÖðÐÐдÈ루¾ÍÊÇÿһ´ÎÔËÐв»¸²¸ÇÒÔǰµÄÄÚÈÝ£¬¶øÊÇ´Ó¿Õ°×µÄÒ»ÐÐдÈ룩¡£Ð»Ð»£¡ Private Sub Command1_Click() If Trim(Text1) = "" Or Trim(Text2) = "" Or Trim(Text3) = "" Or Trim(Text4) = "" _ Or Trim(Combo1) = "" Or Trim(Combo2) = "" Then MsgBox "ÇëÊäÈëÍêÕûÐÅÏ¢", vbCritical, "Ìáʾ" Text1.SetFocus Exit Sub End If b = Text2 c = Text3 If b <= c Then MsgBox "²ÉÑùÊýӦСÓÚ/µÈÓÚ×ܳµÊý", vbCritical, "Ìáʾ" Text2.SetFocus Exit Sub End If Max = b Min = 1 Amount = c - 1 ReDim a(Amount) Randomize For i = 0 To Amount a(i) = Int((Max - Min + 1) * Rnd + Min) For j = 0 To i If i <> j And a(i) = a(j) Then i = i - 1 Next Next Text5 = Text1 & "£»" & vbCrLf & Combo1.Text & "," & "¹²" & b & "¸öÊý×Ö" & "," & _ c & "¸öËæ»úÊý" & "£»" & vbCrLf & "Ëæ»úÊýΪ£º" & Join(a, "," & "£»" & _vbCrLf & Combo2.Text & "," & "²Ù×÷ÈËÔ±£º" & Text4 & "¡£" Static n As Integer FileName = "D:\Ëæ»ú³éºÅ\ÀúÊ·¼Ç¼.xls" On Error Resume Next Set xlApp = GetObject(, "Excel.Application" If Err.Number <> 0 Then Set xlApp = CreateObject("Excel.Application" xlApp.Visible = False End If If Dir(FileName) = "" Then MsgBox FileName & "δÕÒµ½£¡", vbCritical, "Ìáʾ" Exit Sub End If Set xlBook = xlApp.Workbooks.Open(FileName) Set xlsheet = xlApp.Worksheets(1) xlsheet.Activate With ActiveSheet.UsedRange n = .Cells(.Rows.Count, .Columns.Count).Row End With xlsheet.Cells(n + 1, 1) = Now() xlsheet.Cells(n + 1, 2) = Text1 xlsheet.Cells(n + 1, 3) = Combo1.Text xlsheet.Cells(n + 1, 4) = Text2 xlsheet.Cells(n + 1, 5) = Text3 xlsheet.Cells(n + 1, 6) = Join(a, "," ![]() xlsheet.Cells(n + 1, 7) = Combo2.Text xlsheet.Cells(n + 1, 8) = Text4 End Sub |
» ²ÂÄãϲ»¶
Çóµ÷¼Á
ÒѾÓÐ3È˻ظ´
²ÄÁÏ277Çóµ÷¼Á
ÒѾÓÐ7È˻ظ´
ÊýÒ»Ó¢Ò»271ר˶£¨085401£©Çóµ÷¼Á£¬¿É¿ç
ÒѾÓÐ5È˻ظ´
291Çóµ÷¼Á
ÒѾÓÐ21È˻ظ´
Ò»Ö¾Ô¸¹þ¶û±õ¹¤Òµ´óѧ²ÄÁÏÓ뻯¹¤·½Ïò336·Ö
ÒѾÓÐ8È˻ظ´
ҩѧ105500Çóµ÷¼Á
ÒѾÓÐ3È˻ظ´
¿¼Ñе÷¼Á
ÒѾÓÐ4È˻ظ´
0703»¯Ñ§
ÒѾÓÐ7È˻ظ´
ѧ˶274Çóµ÷¼Á
ÒѾÓÐ6È˻ظ´
321Çóµ÷¼Á
ÒѾÓÐ6È˻ظ´

gemjzh
ͳæ (³õÈëÎÄ̳)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 127.9
- ºì»¨: 1
- Ìû×Ó: 31
- ÔÚÏß: 20.4Сʱ
- ³æºÅ: 4826224
- ×¢²á: 2016-07-08
- ÐÔ±ð: GG
- רҵ: ú̿µØÏ¿ª²É

2Â¥2018-10-30 21:38:32
smitest
ľ³æ (СÓÐÃûÆø)
- Ó¦Öú: 4 (Ó×¶ùÔ°)
- ½ð±Ò: 2825.7
- ºì»¨: 4
- Ìû×Ó: 191
- ÔÚÏß: 20Сʱ
- ³æºÅ: 992136
- ×¢²á: 2010-04-08
- רҵ: Ô×ӺͷÖ×ÓÎïÀí
¡¾´ð°¸¡¿Ó¦Öú»ØÌû
¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
gemjzh: ½ð±Ò+10, ¡ï¡ï¡ïºÜÓаïÖú 2018-11-02 09:38:30
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
gemjzh: ½ð±Ò+10, ¡ï¡ï¡ïºÜÓаïÖú 2018-11-02 09:38:30
| With xlbook.ActiveSheet.UsedRange |
3Â¥2018-10-31 19:54:02














& "£»" & _
»Ø¸´´ËÂ¥