- ©«¤l
- 2
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 3
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows
- ³nÅ骩¥»
- Win7
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- ¨Ó¦Û
- Taichung
- µù¥U®É¶¡
- 2015-6-13
- ³Ì«áµn¿ý
- 2015-6-22
|
[µo°Ý] ¼g§PÂ_¦¡¦pªG¸õ²æ¥Îªº¼ÆÈn±qì©l¸ê®Æ¤¤§ì¨ú¸Ó¦p¦ó¬O¦n
¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-6-20 14:16 ½s¿è
¤p©f¤£¤~¡A¼g¤F¤@¬q§PÂ_ì©lEXCEL¤u§@ªí¤¤ªºªí®æ¨®½ø¼Æ
ì©l¸ê®Æªí®æ¦p¤U
¥i¬O¶]µ{¦¡®É·|¥X²{¸ê®Æ«¬ºA¤£¥¿½Tªº¿ù»~°T®§
µ{¦¡¦p¤U
Sub ¨®½ø¦hµ§©î¦¨¤@µ§()
Dim car_num, last_row As Integer
Dim mycell As Range
ActiveSheet.Cells.SpecialCells(xlLastCell).Select
last_row = Selection.Row
For i = 1 To last_row
Set mycell = ActiveSheet.Cells(i, 2)
car_num = mycell.Value
If car_num > 1 Then
mycell.Interior.ColorIndex = 2
For j = 1 To car_num <-----¿ù»~¥X²{¦æ¡A©Ò¥H¬O¤£¯à±N¸ê®Æªí®æ¤¤ªºÈ·í§@¯u¥¿ªº¼Æ¦r¥h¶]¦^°é¶Ü??¥i¬O³o¬O°ß¤@§PÂ_ªº¼ÆÈ°Ú..¨D¸Ñ TT
mycell.Rows(i).Insert
mycell.Rows(i).Copy Destination:=mycell.Rows(i + j)
a = ActiveSheet.Cells(i, car_num).Value
ActiveSheet.Cells(i, car_num).Value = a / car_num
b = ActiveSheet.Cells(i, 8).Value
ActiveSheet.Cells(i, 8).Value = b / car_num
c = ActiveSheet.Cells(i, 9).Value
ActiveSheet.Cells(i, 9).Value = c / car_num
ActiveSheet.Cells(i, 11).Value = ActiveSheet.Cells(i, 9).Value * ActiveSheet.Cells(i, 10).Value
d = ActiveSheet.Cells(i, 12).Value
ActiveSheet.Cells(i, 12).Value = d / car_num
e = ActiveSheet.Cells(i, 13).Value
ActiveSheet.Cells(i, 13).Value = e / car_num
f = ActiveSheet.Cells(i, 14).Value
ActiveSheet.Cells(i, 14).Value = f / car_num
Next j
End If
Next i
End Sub |
|