¼ÐÃD:
[µo°Ý]
즳¤u§@ªí¤¤¤£¦PÄæ¦ì¸ê®Æ¡AÂಾ¨ì·s²£¥Í¤u§@ªí¤¤¡A¨Ã«·s¦w±Æ¦ì¸m(¤w¸Ñ¨M)
[¥´¦L¥»¶]
§@ªÌ:
jesscc
®É¶¡:
2011-4-4 09:05
¼ÐÃD:
즳¤u§@ªí¤¤¤£¦PÄæ¦ì¸ê®Æ¡AÂಾ¨ì·s²£¥Í¤u§@ªí¤¤¡A¨Ã«·s¦w±Æ¦ì¸m(¤w¸Ñ¨M)
¥»©«³Ì«á¥Ñ jesscc ©ó 2011-4-7 00:07 ½s¿è
¦U¦ì°ª¤â¦n¡A¤p§Ìªì¾Ç¡A¸I¨ì³\¦h²~ÀV¸Ñ¤£¶}¡AÁÙ±æ¦U¦ì¸Ñ´b¡C¬O³o¼Ëªº¡A§Úªº¤u§@¦p¤Uz:
«ö¤U"¸ê®Æ¨Ó·½"¤u§@ªí¤¤ªº"¸ê®ÆÂಾ"«ö¶s«á¡A·|«Ø¥ß¤@Ó·s¤u§@ªí¡A·s¤u§@ªí¦WºÙ±N¥H"¸ê®Æ¨Ó·½"¤u§@ªí¤¤ªºB3©R¦W¡AµM«á§â"¸ê®Æ¨Ó·½"¤u§@ªí¤¤¬ÛÃö¼Æ¾Ú¶K¨ì³oÓ·s²£¥Íªº¤u§@ªí¤¤¡A¦p¦P"ªÑ²¼A"¤u§@ªíªº¦w±Æ¨º¼Ë¡C
¦ý¬O²{¦b¥u¼g¨ì«Ø¥ß·sªº¤u§@ªí¡AÀY´ß¤w¸g§ÖÃz¤F¡A¦]¬°¦b«Ø¥ß·s¤u§@ªíªº¦P®É¡AÁÙn§PÂ_"¸ê®Æ¨Ó·½"¤u§@ªí¤¤
1.B3¬O§_¬°ªÅÈ(³o³¡¤À¤w¸Ñ¨M)
2.¥HB3¬°¦WºÙªº¤u§@ªí¬O§_¤w¦s¦b¡AY¤w¦s¦b¡A´N¤£¥Î«Ø¥ß·sªº¤u§@ªí¡A¥u¶K¤J¸ê®Æ§Y¥i
3.¬Û¦Pªº¤é´Á¡A¬O§_¦b¬Û¦P¤@¦C¤W
¥H¤W¬O¥Ø«e§Ú©Ò¸I¨ìªº°ÝÃD¡A§Æ±æ¦U¦ì°ª¤â¯à±Ð±Ð§Ú¡A·P®¦¤£ºÉ¡C
§@ªÌ:
Hsieh
®É¶¡:
2011-4-4 09:58
¦^´_
1#
jesscc
Sub SourceData_S()
Dim Ay()
With Worksheets("¸ê®Æ¨Ó·½")
Set Rng = .Range("A3:B3")
fs = False
If .Range("B3").Value = "" Then
MsgBox "µLªk¨ú±oªÑ²¼¦WºÙ,½Ð½T©wªÑ²¼¦WºÙ¤w¶ñ¤JB3Àx¦s®æ", 32, "¸ê®Æ¿ù»~!"
Exit Sub
End If
For Each sh In Sheets
If sh.Name = .[B3].Text Then fs = True: Exit For
Next
If fs = False Then Sheets.Add.Name = .[B3].Text
ar = Array("A", "C", "I", "P")
ReDim Preserve Ay(s)
Ay(s) = Array(.Cells(4, ar(0)).Value, .Cells(4, ar(1)).Value, .Cells(4, ar(2)).Value, .Cells(4, ar(3)).Value)
s = s + 1
For i = 5 To .Cells(.Rows.Count, 1).End(xlUp).Row
If Weekday(.Cells(i, ar(0)), vbMonday) < 5 Then
ReDim Preserve Ay(s)
Ay(s) = Array(.Cells(i, ar(0)).Text, .Cells(i, ar(1)).Value, .Cells(i, ar(2)).Value, .Cells(i, ar(3)).Value)
s = s + 1
Else
ReDim Preserve Ay(s)
Ay(s) = Array(.Cells(i, ar(0)).Text, .Cells(i, ar(1)).Value, .Cells(i, ar(2)).Value, .Cells(i, ar(3)).Value)
s = s + 1
ReDim Preserve Ay(s)
Ay(s) = Array("", "", "", "")
s = s + 1
End If
Next
With Sheets(Sheets("¸ê®Æ¨Ó·½").[B3].Text)
Rng.Copy .[A1]
With .Range(.[A3], .Cells(.Rows.Count, 6))
.ClearContents
.Columns(1).NumberFormat = "yyyy/mm/dd"
End With
.[A2].Resize(s, 4) = Application.Transpose(Application.Transpose(Ay))
.Columns("A").AutoFit
End With
End With
End Sub
½Æ»s¥N½X
§@ªÌ:
jesscc
®É¶¡:
2011-4-4 10:36
·R¦º§A¤F Hsieh ¤j¤j
«ç»ò¨º»ò¼F®`¡A¤~¨S´X¤ÀÄÁªº®É¶¡¡A´N§¹¦¨¤F¡C
§Ú·Qnªºµ²ªG³£¥X¨Ó¤F¡A¥i¬O¬Ý¤£¤ÓÀ´µ{¦¡ªº¹B§@¡A¹ê¦b¤Ó°ª²`¤F¡C¥i¥H³Â·Ð¤j¤jÁ¿¸Ñ¤@¤U«ÂI¶Ü?
§@ªÌ:
Hsieh
®É¶¡:
2011-4-4 10:52
¦^´_
3#
jesscc
Sub SourceData_S()
Dim Ay()
With Worksheets("¸ê®Æ¨Ó·½")
Set Rng = .Range("A3:B3")
fs = False
If .Range("B3").Value = "" Then
MsgBox "µLªk¨ú±oªÑ²¼¦WºÙ,½Ð½T©wªÑ²¼¦WºÙ¤w¶ñ¤JB3Àx¦s®æ", 32, "¸ê®Æ¿ù»~!"
Exit Sub
End If
For Each sh In Sheets 'Àˬd¤u§@ªí¦WºÙ¬O§_¦s¦b
If sh.Name = .[B3].Text Then fs = True: Exit For
Next
If fs = False Then Sheets.Add.Name = .[B3].Text '¦pªG¤u§@ªí¤£¦s¦b´N·s¼W¤u§@ªí
ar = Array("A", "C", "I", "P") '»Ýn´£¨úªºÄæ¦ì
ReDim Preserve Ay(s) '¡A±N¼ÐÃD¦C¦s¤J°}¦Cªº²Ä¤@µ§¨ÃÂX¤j°}¦C
Ay(s) = Array(.Cells(4, ar(0)).Value, .Cells(4, ar(1)).Value, .Cells(4, ar(2)).Value, .Cells(4, ar(3)).Value)
s = s + 1
For i = 5 To .Cells(.Rows.Count, 1).End(xlUp).Row '¶i¤J¸ê®Æ°j°é
If Weekday(.Cells(i, ar(0)), vbMonday) < 5 Then '§PÂ_¤é´Á¬°¬P´Á´X¡A¬P´Á5¥H«e°õ¦æ
ReDim Preserve Ay(s) '±N¸ê®Æ¦s¤J°}¦C
Ay(s) = Array(.Cells(i, ar(0)).Text, .Cells(i, ar(1)).Value, .Cells(i, ar(2)).Value, .Cells(i, ar(3)).Value)
s = s + 1
Else '¬P´Á¤°õ¦æ
ReDim Preserve Ay(s) '±N¸ê®Æ¦s¤J°}¦C
Ay(s) = Array(.Cells(i, ar(0)).Text, .Cells(i, ar(1)).Value, .Cells(i, ar(2)).Value, .Cells(i, ar(3)).Value)
s = s + 1
ReDim Preserve Ay(s) 'Àx¦s¤@ӪťզC¨ì°}¦C
Ay(s) = Array("", "", "", "")
s = s + 1
End If
Next
With Sheets(Sheets("¸ê®Æ¨Ó·½").[B3].Text)
Rng.Copy .[A1] 'ªÑ²¼¦WºÙ
With .Range(.[A3], .Cells(.Rows.Count, 6))
.ClearContents '²M°£ì¨Ó¸ê®Æ
.Columns(1).NumberFormat = "yyyy/mm/dd" '³]©wAÄ欰¤é´Á®æ¦¡
End With
.[A2].Resize(s, 4) = Application.Transpose(Application.Transpose(Ay)) '±N°}¦Cȼg¤J¤u§@ªí
.Columns("A").AutoFit 'AÄæ¦Û°ÊÄæ¼e
End With
End With
End Sub
½Æ»s¥N½X
§@ªÌ:
jesscc
®É¶¡:
2011-4-4 10:59
¹ê¦b¨ØªA¨ì¤Åé§ë¦a¡A±j!
§@ªÌ:
jesscc
®É¶¡:
2011-4-4 15:59
¤j¤j¤S¨Ó³Â·Ð±z¤F¡A¯u¤£¦n·N«ä¡C¥»¨Ó§Ú¬O·Q¦Û¤vק諸¡A¥i¬O¬ã¨s¤F¤@¤U¤È¡A¯à¤O¹ê¦b¤£°÷¡A§ï¤£¥X¨Ó¡C
¬O³o¼Ëªº¡A§Ú·Q¦b·s¼Wªº¤u§@ªí¤¤¦A¦P®É¥[¤JC1¤ÎE2¤å¦r©MD1(§Q¥ÎDDE¨úÈ=YES|DQ!'2882.Capital')¡A2882¬OªÑ²¼¥N¸¹¡A§Q¥Î"¸ê®Æ¨Ó·½"¤u§@ªí¤¤ªºA3¨ú±o¡C
µM«á¦bEÄæ¡A±qE3¥H¤U¶}©lpºâC3*D3/D1,C4*D4/D1,C5*D5/D1,.....¡A¤£ª¾¸Ó«ç»ò°µ?
ÁÙ¦³¤@ÂI¤]¬Oèèµo²{ªº¡A°²³]²{¦b"°ê®õª÷"¦³·s¸ê®Æ(2011/1/17¶}©l)¡An¥[¤J¨ì¸ê®Æ2011/1/14¤§«á¡An¦p¦ó°µ¤~·|¶K¨ì¸ê®Æ¤§«á¡A¦Ó¤£·|Âл\±¼Â¸ê®Æ?
¤wªþ¤W·s´ú¸ÕÀÉ
§@ªÌ:
Hsieh
®É¶¡:
2011-4-4 16:50
¦^´_
6#
jesscc
Sub SourceData_S()
Dim Ay()
With Worksheets("¸ê®Æ¨Ó·½")
Set Rng = .Range("A3:B3")
fs = False
If .Range("B3").Value = "" Then
MsgBox "µLªk¨ú±oªÑ²¼¦WºÙ,½Ð½T©wªÑ²¼¦WºÙ¤w¶ñ¤JB3Àx¦s®æ", 32, "¸ê®Æ¿ù»~!"
Exit Sub
End If
For Each sh In Sheets 'Àˬd¤u§@ªí¦WºÙ¬O§_¦s¦b
If sh.Name = .[B3].Text Then fs = True: Exit For
Next
If fs = False Then Sheets.Add.Name = .[B3].Text '¦pªG¤u§@ªí¤£¦s¦b´N·s¼W¤u§@ªí
ar = Array("A", "C", "I", "P") '»Ýn´£¨úªºÄæ¦ì
If fs = False Then '¦pªG¬O·s¼W¤u§@ªí¡A´N¦s¤J¼ÐÃD
ReDim Preserve Ay(s) '±N¼ÐÃD¦C¦s¤J°}¦Cªº²Ä¤@µ§¨ÃÂX¤j°}¦C
Ay(s) = Array(.Cells(4, ar(0)).Value, .Cells(4, ar(1)).Value, .Cells(4, ar(2)).Value, .Cells(4, ar(3)).Value, "¦¨¥æ¶q¥eªÑ¥»¤ñ¨Ò")
s = s + 1
End If
For i = 5 To .Cells(.Rows.Count, 1).End(xlUp).Row '¶i¤J¸ê®Æ°j°é
If Weekday(.Cells(i, ar(0)), vbMonday) < 5 Then '§PÂ_¤é´Á¬°¬P´Á´X¡A¬P´Á5¥H«e°õ¦æ
ReDim Preserve Ay(s) '±N¸ê®Æ¦s¤J°}¦C
Ay(s) = Array(.Cells(i, ar(0)).Text, .Cells(i, ar(1)).Value, .Cells(i, ar(2)).Value, .Cells(i, ar(3)).Value, "=RC[-2]*RC[-1]/R1C4")
s = s + 1
Else '¬P´Á¤°õ¦æ
ReDim Preserve Ay(s) '±N¸ê®Æ¦s¤J°}¦C
Ay(s) = Array(.Cells(i, ar(0)).Text, .Cells(i, ar(1)).Value, .Cells(i, ar(2)).Value, .Cells(i, ar(3)).Value, "=RC[-2]*RC[-1]/R1C4")
s = s + 1
ReDim Preserve Ay(s) 'Àx¦s¤@ӪťզC¨ì°}¦C
Ay(s) = Array("", "", "", "", "")
s = s + 1
End If
Next
With Sheets(Sheets("¸ê®Æ¨Ó·½").[B3].Text)
Rng.Copy .[a1] 'ªÑ²¼¦WºÙ
.[C1] = "ªÑ¥»(±i)": .[D1].FormulaLocal = "=YES|DQ!'" & .[a1] & ".Capital'*1000"
With .Range(.[A3], .Cells(.Rows.Count, 6))
'.ClearContents '²M°£ì¨Ó¸ê®Æ
.Columns(1).NumberFormat = "yyyy/mm/dd" '³]©wAÄ欰¤é´Á®æ¦¡
End With
.Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0).Resize(s, 5) = Application.Transpose(Application.Transpose(Ay)) '±N°}¦Cȼg¤J¤u§@ªí
.Columns("A:E").AutoFit 'A:EÄæ¦Û°ÊÄæ¼e
End With
End With
End Sub
½Æ»s¥N½X
§@ªÌ:
jesscc
®É¶¡:
2011-4-4 17:09
¦¬¨ì¤F¡C
±z¯u¬O¤j·R¤§¤H¡A¤µ«án»{¯u¦V±z¾Ç²ß¡C
ÁÂÁÂ!
§@ªÌ:
jesscc
®É¶¡:
2011-4-6 12:25
Hsieh ¤j
§Ú¬ã¨s¤F¨â¤ÑÁÙ¬O¦³«Ü¦h°ÝÃD
4¡B5¡B11¦æªº Rng¡Bfs¡Bsh ¬O«O¯d¦r¶Ü?
Àx¦s®æªº¿ï¨ú¦³¦n¦hºØ¤è¦¡¡A¨ì©³¦³¤°»ò®t§O?¦p6¡B35¦æ
¥t¥~²Ä41¦æ¡A¾ã¦æ³£¬Ý¤£À´@@
§@ªÌ:
Hsieh
®É¶¡:
2011-4-6 14:13
¦^´_
9#
jesscc
Rng,sh,fs³o¨Ç¤£¥s«O¯d¦r¡A³o¨ÇºÙ¬°ÅܼÆ
¥Ñ¦Û¤vÀ°¬YÓÀH®ÉÅܰʪºÈ¡A©Ò¨ú¦W¦r¡A´N¹³°ê¤¤¼Æ¾Çªº¥N¼Æ¬O¦P¼Ëªº·N¸q
¦Ü©óÀx¦s®æªº¼gªk¦³«Ü¦h
¼Ð·Ç¼gªkCells(row,column)
¦b¬A¸¹¤º¿é¤J¦C¸¹»PÄ渹
³o¬O«ü©w³æ¤@Àx¦s®æªº¼Ð·Ç¼gªk
n«ü©w½d³ò®ÉRange(address)
¦b¬A¸¹¤º¿é¤J½d³òªº¦ì§}¦r¦ê
³o¬O«ü©w½d³òªº¼Ð·Ç¼gªk
¥t¤@ºØ¥H¤¤¬A¸¹ªí¥Üªº¤èªk[name]
¦¹ªk¬O¤@ºØª«¥ó¥]¸Ë¼gªk¡A¬A¸¹¤º¿é¤Jªº¬O¥Nªí½d³òªº¦WºÙ
¦p[A1]¡AA1¦b¤u§@ªí¤¤©Ò¾Ö¦³ªº·N¸q¬O«ü¡A²Ä¤@¦C²Ä¤@ÄæÀx¦s®æªº¦W¦r
¦Ü©ó²Ä41¦æ.Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0).Resize(s,5)
³o¬O¼Ð·ÇªºCELLS¼gªk¡A§A¥²¶·©î¶}¨Ó¸ÑÄÀ´N¯à¤F¸Ñ
.Cells(.Rows.Count, 1)¬A¸¹¤¤²Ä¤@Ӥ޼ƬO¦C¸¹¡A³oùبϥÎ.Rows.Count
¬O¦]¬°²{¦bEXCELªºª©¥»¤£¦P¡A¤u§@ªíªºÁ`¦C¼Æ·|¤£¦P
§A¬O2003ª©¥»©Ò¥H³o¸Ì§ï¦¨65536¤]¬O¤@¼Ëªº
³o¬On±o¨ìAÄæ³Ì©³¤U¤@¦CªºÀx¦s®æ
End(xlUp)¬O¦V¤W¨ì¸ê®Æªº³Ì©³³¡
Offset(1, 0)¬O¦V¤U¤@®æªº¦ì¸m
Resize(s,5)¬O°ò·ÇÀx¦s®æ¦ì¸m¦V¤Us¦C¦V¥k5ÄæÂX®iªº½d³ò
§@ªÌ:
jesscc
®É¶¡:
2011-4-6 15:04
¤]´N¬O»¡²Ä4¦æ
Set Rng = .Range("A3:B3")
¥i¥H¼g¦¨
Set Rng = .[A3:B3]
¬O³o¼Ë¶Ü?
¥t¥~
Resize(s,5)¬A¸¹¤¤ªºs´N¬O²Ä18¦æªºs¶Ü?
§@ªÌ:
Hsieh
®É¶¡:
2011-4-6 18:09
¦^´_
11#
jesscc
¨S¿ù
Set Rng = .Range("A3:B3")
¥i¥H¼g¦¨
Set Rng = .[A3:B3]
S´N¬O°}¦C¨ì³Ì«á·|¦³ªº¤¸¯À¼Æ¶q
¦]¬°¸Ó°}¦C¬O¤Gºû°}¦C
¨CÓ¤¸¯À¬O¥Ñ¤@ºû°}¦C©Ò²Õ¦¨
¦]¬°§Aªº¸ê®Æ¦b¬P´Á¤«á±n¼W¥[¤@ӪťզC
©Ò¥HS·|¬O©Ò¦³¸ê®Æ¥[¤W´XÓ¬P´Á¤ªº¼Æ¶q
§@ªÌ:
bobby0204
®É¶¡:
2011-6-14 15:25
Hsieh ¤j¤j
§Ú¦³¤@ÓÃþ¦üªº°ÝÃD
·Q½Ð°Ý
¤è«K¶Ü?
Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)