- ©«¤l
- 81
- ¥DÃD
- 27
- ºëµØ
- 0
- ¿n¤À
- 151
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2012-6-7
- ³Ì«áµn¿ý
- 2020-11-27

|
קïµ{¦¡
¦]Àɮ׶V¨Ó¶V¤j, ¥Øªº¸ê®Æ¤v¨ì¤F115000µ§, ¦Ó¨CӤ몺¨Ó·½¸ê®Æ¦Ü¤Ö³£¦³9000¦hµ§, ¥Î¥H¤Uªºµ{¦¡¨Órun, ¨C¦¸³£n¶]2~3¤p®É.
¤£ª¾°ª¤â̬O§_¥i¥H±Ð¾Éקïµ{¦¡,¥i¥HÅý¸ê®Æªº¿é¤J³t«×¥i¥H§Ö¤@¨Ç ?
Public put_column, row_clear, row_index, put_row, row_search As Long
Sub §ì¸ê®Æ()
put_column = Sheets("§@·~°Ï").Range("b1").Value
Sheets("Summary").Activate
ans0 = MsgBox("½T©w¬OLoad¦Ü¡i" & put_column & "¡jÄæ¶Ü¡H", vbYesNo, "½Ð½T»{")
If ans0 <> 6 Then
Sheets("§@·~°Ï").Activate
Range("b1").Select
ans2 = MsgBox("½Ð«·s¿é¤J¥¿½TªºÄæ¦ì¡I")
End
End If
ans = MsgBox("n²MªÅ ¡i" & put_column & "¡jÄ檺¸ê®Æ¶Ü¡H" & Chr(13) & Chr(13) & "¡i¬O¡j¡÷ ²MªÅ¡A¦A©ñ¤J¼Æ¾Ú" & Chr(13) & Chr(13) & "¡i§_¡j¡÷ ¤£²MªÅ¡A¼Æ¾ÚÄ~Äò²Ö¥[", vbYesNo, "½Ð½T»{")
If ans = 6 Then
row_clear = 3
While Cells(row_clear, 1).Value <> ""
row_clear = row_clear + 1
Wend
Range(put_column & Format(3) & ":" & put_column & Format(row_clear)).ClearContents
load_data
Else
load_data
End If
End Sub
Sub load_data()
row_index = 2
'±qdataªº²Ä¤G¦C¶}©l´M§ä,¤@ª½§ä¦ÜTotal¬°¤î
While Left(Sheets("data").Cells(row_index, 9).Value, 5) <> "Total"
Prod = Sheets("data").Cells(row_index, 3).Value
If Prod = "Electro-Dip" Or Prod = "Electro" Then
'±N¥|ÓÄæ¦ì³sµ²°_¨Ó
data_four_column = Sheets("data").Cells(row_index, 2).Value & Sheets("data").Cells(row_index, 3).Value & Sheets("data").Cells(row_index, 4).Value & Sheets("data").Cells(row_index, 9).Value
'¦pªGSummaryªºa3Àx¦s®æ¬OªÅ¥Õ
If Sheets("Summary").Cells(3, 1).Value = "" Then
'´Nª½±µ±N§ä¨ìªº²Ä¤@µ§¸ê®Æ©ñ¶i²Ä¤T¦C
Sheets("Summary").Cells(3, 1).Value = Sheets("data").Cells(row_index, 2).Value
Sheets("Summary").Cells(3, 2).Value = Sheets("data").Cells(row_index, 3).Value
Sheets("Summary").Cells(3, 3).Value = Sheets("data").Cells(row_index, 4).Value
Sheets("Summary").Cells(3, 4).Value = Sheets("data").Cells(row_index, 9).Value
Sheets("Summary").Range(put_column & Format(3)).Value = Sheets("data").Cells(row_index, 10).Value
'§_«h
Else
'±q²Ä¤T¦C¶}©l§ä°_
row_search = 3
got_it = False
'¤@ª½§ä¨ìªÅ¥Õ¬°¤î
While Sheets("Summary").Cells(row_search, 1).Value <> ""
'±NSummaryªº¥|ÓÄæ¦ì³sµ²°_¨Ó
four_column = Sheets("Summary").Cells(row_search, 1).Value & Sheets("Summary").Cells(row_search, 2).Value & Sheets("Summary").Cells(row_search, 3).Value & Sheets("Summary").Cells(row_search, 4).Value
'¦pªG¦bdata§ä¨ìªº¸ê®Æ¸ò¦bSummary§ä¨ìªº¬Û¦P,´N§â¼Æ¶q¬Û¥[
If data_four_column = four_column Then
got_it = True
Sheets("Summary").Range(put_column & Format(row_search)).Value = Sheets("Summary").Range(put_column & Format(row_search)).Value + Sheets("data").Cells(row_index, 10).Value
End If
row_search = row_search + 1
Wend
'¦pªG¨S¦³§ä¨ì¬Û¦Pªº
If got_it = False Then
'´N¦b³Ì«á¤@¦C·s¼W¤@µ§
Sheets("Summary").Cells(row_search, 1).Value = Sheets("data").Cells(row_index, 2).Value
Sheets("Summary").Cells(row_search, 2).Value = Sheets("data").Cells(row_index, 3).Value
Sheets("Summary").Cells(row_search, 3).Value = Sheets("data").Cells(row_index, 4).Value
Sheets("Summary").Cells(row_search, 4).Value = Sheets("data").Cells(row_index, 9).Value
Sheets("Summary").Range(put_column & Format(row_search)).Value = Sheets("data").Cells(row_index, 10).Value
row_search = row_search + 1
End If
End If
End If
row_index = row_index + 1
Wend
ans = MsgBox("¤w§¹¦¨!")
End Sub |
-
-
µ{¦¡×§ï.zip
(435.06 KB)
|