¥»©«³Ì«á¥Ñ hong912 ©ó 2014-12-22 18:20 ½s¿è
¤j¤jÌ, ¦n
¤U¦C¬O¤@Óªí³æµ{¦¡, ¤p§Ì·Q§âªí³æ¿é¤Jªº¸ê®Æ, ¦s©ó¥t¤@±i¤u§@ªí2, ¨Ã±q¤u§@ªí2, aÄæ¶}©l, ½Ð±Ð¤j¤j̦p¦óקï, ÁÂÁÂÁÂ!
Private Sub SaveData_Click()
With UserForm1
co = Trim(.Company.Value)
ad = Trim(.Address.Value)
yn = MsgBox("¬O§_5²Õ¸ê®Æ§¹¾ã¿é¤J", vbYesNo)
cts = Array(Company, Address, TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, TextBox7, TextBox8)
ctsname = Array(.Label1.Caption, .Label2.Caption, .Label3.Caption, .Label4.Caption, .Label5.Caption, .Label6.Caption, .Label7.Caption, .Label8.Caption, .Label9.Caption, .Label10.Caption)
k = 0
With ActiveSheet
ar = Array(co, ad, TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, TextBox7, TextBox8)
For i = 36 To 48 Step 3
If ar(j) <> "" Then
If Not .Columns(i).Find(ar(j), lookat:=xlWhole) Is Nothing Then
MsgBox "¸ê®Æ«½Æ¡I¡I " & ctsname(j), vbCritical + vbOKOnly, "½ÐÀˬd"
Exit Sub
Else
r = .Cells(65536, i).End(xlUp).Offset(1, 0).Row
.Cells(65536, i).End(xlUp).Offset(1, 0).Resize(, 2) = Array(ar(j), ar(j + 1))
End If
End If
j = j + 2
Next
End With
If MsgBox("¬O§_Ä~Äò¿é¤J¡H", vbQuestion + vbYesNo, "½Ð½T»{") = vbNo Then
Unload UserForm1
Else
Unload Me
UserForm1.Show
UserForm1.Company.SetFocus
[a1].Select
End If
End With
End Sub |