¼ÐÃD:
¦p¦ó§ó§ï¨ä¥LªÑ¸¹¡Anþ¨Ç¨BÆJ¡H
[¥´¦L¥»¶]
§@ªÌ:
cfuxiong
®É¶¡:
2012-4-26 21:37
¼ÐÃD:
¦p¦ó§ó§ï¨ä¥LªÑ¸¹¡Anþ¨Ç¨BÆJ¡H
½Ð±Ðª©¤j°ª¤â«üÂI¡FÁÂÁÂ~~
1.§Ú¦b[¶×¤J]Äæ¡A¾Þ§@[¸ê®Æ]¡÷[¶×¤J¥~³¡¸ê®Æ]¡÷[½s¿è¬d¸ß]¡÷§â[2303Áp¹q]§ï¦¨[2330¥x¿n¹q]¡÷[°O¿ý]Äæ«o¤£¯à§ó·s¦¨[2330¥x¿n¹q]Data¡A5¤ÀÄÁ«á¤SÁÙì[2303Áp¹q]½Ð°Ý¦p¦ó³B¸m¡H§ó§ï¨ä¥LªÑ¸¹¡Anþ¨Ç¨BÆJ¡H
2.½d¨Ò¡G10¬í§ó·s¸ê®Æ=>Application.OnTime Now + TimeValue("00:00:10"), "MyDee" '³]©w 10¬í«á °õ¦æ MyDee µ{§Ç
Exit Sub
n§ï¦¨5¤À§ó·s¸ê®Æ=>Application.OnTime Now + TimeValue("00:05:00"), "MyDee" '³]©w 5¤À«á °õ¦æ MyDee µ{§Ç
³o¼Ë¹ï¶Ü¡Hn¦p¦ó¦sÀÉ¡H
§@ªÌ:
c_c_lai
®É¶¡:
2012-4-27 07:55
¦^´_
1#
cfuxiong
¨º§A¬°¦ó¤£³o»ò°µ¡G °²³]¦b§Aªº "¶×¤J" ¤u§@ªí³æ¤ºªº P1 Äæ¦ì¿é¤J -> "®É¬q³]©w"¡A P2 Äæ¦ì¿é¤J -> "00:05:00"¡A¦Ó±N
Application.OnTime Now + TimeValue("00:00:10"), "MyDee" ק令
Application.OnTime (Now + Sheets("¶×¤J").Range("P2").Value), "ThisWorkBook.MyDee"¡A¦p¦¹¡A¥H«á¥un§A¤£°ª¿³´N¨ì
P2 Äæ¦ì¨Óקï§A°ª¿³ªº³]©w®É¬q¡A¨º¤£´Nµ²¤F¡I
§@ªÌ:
cfuxiong
®É¶¡:
2012-4-27 10:54
¦^´_
2#
c_c_lai
ÁÂÁÂc_c_laiªº«ü¾É»PÀ°¦£¡A¨ì¥Ø«e¬°¤î¡A¥Î¡mApplication.OnTime Now + TimeValue("00:05:00"), "MyDee" '³]©w 5¤À«á °õ¦æ MyDee µ{§Ç¡n¬OOK
¤]¸Õ¹L§A«ü¾Éªº¤èªk¡A¦ý«o¥X²{¡¨¶¥¬q¿ù»~13¡¨¤£ª¾¦ó³B¥X¿ù¡H
²{¦b¬O·Qn§ó§ï[ªÑ¸¹]«o¤£ª¾¦p¦ó¤U¤â¡F
§Ú¦b[¶×¤J]Äæ¡A¾Þ§@[¸ê®Æ]¡÷[¶×¤J¥~³¡¸ê®Æ]¡÷[½s¿è¬d¸ß]¡÷§â[2303Áp¹q]§ï¦¨[2330¥x¿n¹q]¡÷[°O¿ý]Äæ«o¤£¯à§ó·s¦¨[2330¥x¿n¹q]Data¡A5¤ÀÄÁ«á¤SÁÙì[2303Áp¹q]½Ð°Ý¦p¦ó³B¸m¡H§ó§ï¨ä¥LªÑ¸¹¡Anþ¨Ç¨BÆJ¡HÁÂÁÂ~~
§@ªÌ:
c_c_lai
®É¶¡:
2012-4-27 11:10
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-4-27 11:22 ½s¿è
¦^´_
3#
cfuxiong
½Ð§A¥ýÀˬd¤@¤U
¥N¸¹ = Sheets("¬ö¿ý").[C1]
µ¥½L«á§Ú¦A¬Ý¬Ý¡Aè¤~¤@°õ¦æ§Aªºµ{¦¡¡A´N¥X²{ 400 ªº¿ù»~°T®§¡A
µ²ªG³s±aªº§Úªº§@·~µ{¦¡³ºµM¦Û°Ê°±¤î¤F§ÚªºDDE¸ê®Æ¶×¤J¡I
§@ªÌ:
Hsieh
®É¶¡:
2012-4-27 14:27
¦^´_
3#
cfuxiong
·|µo²{§ó§ïªÑ¸¹«á¤S¥X²{¥ý«eªºªÑ²¼¸ê°T¡A¦³¥i¯à¬O®É¶¡®tªºÃö«Y¡A·í«e¤@Ó¬d¸ß©|¥¼¬d¸ßµ²§ô(¥¿¦b¬d¸ß¤¤)
§A§ó§ï¤FC1ªºªÑ¸¹³o®ÉIJµo¨Æ¥óµ{§Ç¦Ó°õ¦æ§ó·s¡Aµ²ªG¦¹¦¸§ó·s¤ñ«e¤@¦¸§ó·s³t«×§Ö¡A´N¶K¨ì¸ê®Æ°Ï¡Aµ²ªG«e¤@¦¸§ó·s±µµÛ§¹¦¨
©Ò¥H³y¦¨³o¼Ë²{¶H¡A³o»Pºô¸ô¦³Ãö¡A§A§â¬ö¿ý¤u§@ªí¨Æ¥óµ{§Ç§R°£«á°õ¦æ¬Ý¬Ý¡AÀ³¸Ó´N·|®ø°£³oºØ²{¶H
¥t´£¨ì5¤ÀÄÁ°õ¦æ¬O§ï¦¨Now + TimeValue("00:05:00")¨S¿ù
Application.OnTime Now + TimeValue("00:05:00"), "MyDee" '³]©w 5¤ÀÄÁ«á °õ¦æ MyDee µ{§Ç
§@ªÌ:
c_c_lai
®É¶¡:
2012-4-27 15:03
¦^´_
3#
cfuxiong
' Sh.Activate ' *************
' Rng.Select ' *************
³o¨â³B§Ú±N¥¦§ï¦¨µùÄÀ¡A¦]¬°¥¦·|±Nµe±¤£Â_¤Á¨ì "¬ö¿ý" ¤u§@ªí³æ¡A
¦pªG§A¬O¥¿¦bÀˬd "¶×¤J"¤u§@ªí³æ®É¡A³]©w®É¬q¤@¨ìµe±
«K·|³Q±j¨î¤Á¨ì "¬ö¿ý" ¤u§@ªí³æ¤W¡A«D±`§xÂZ¡I
' Application.OnTime Now + TimeValue("00:00:10"), "MyDee" ק令
Application.OnTime (Now + Sheets("¶×¤J").Range("P2").Value), "MyDee"
¦]¬°§Aªºµ{¦¡½X¨Ã¤£¬O©ñ¸m¦b ThisWorkBook °Ï¶ô¤º¡A©Ò¥H "ThisWorkBook.MyDee"
§ï¦¨ "MyDee"¡C
[attach]10703[/attach]
[attach]10704[/attach]
§@ªÌ:
cfuxiong
®É¶¡:
2012-4-27 15:03
¦^´_
5#
Hsieh
ÁÂÁÂHsiehª©¤j«ü¾É¡F
¡m§A§â¬ö¿ý¤u§@ªí¨Æ¥óµ{§Ç§R°£«á°õ¦æ¬Ý¬Ý¡AÀ³¸Ó´N·|®ø°£³oºØ²{¶H¡n§Ú§@¤F¥H¤U°Ê§@¡F
1.¥´¶}Àɮס÷[°±¥Î¥¨¶°]¶i¤J¡÷¦b[¶×¤J]Äæ¡A¾Þ§@[¸ê®Æ]¡÷[¶×¤J¥~³¡¸ê®Æ]¡÷[½s¿è¬d¸ß]¡÷§â[2303Áp¹q]§ï¦¨[2330¥x¿n¹q]=>µe±¬Ý¨Ó¬OOK¡÷Àx¦s¡÷Â÷¶}¡C
2.¦A¥´¶}Àɮס÷[±Ò¥Î¥¨¶°]¶i¤J¡÷¤SÁÙì±Ò©l¸ê®Æ¡C
½Ðª©¤j°ª¤â«ü¾É¡KÁÂÁÂ~~
§@ªÌ:
Hsieh
®É¶¡:
2012-4-27 16:32
¦^´_
7#
cfuxiong
¨Ã«D§ó§ï¬d¸ß
¦]¬°§Aªº±ø¥ó¤w¸g¦bµ{¦¡½X¤¤¨Ï¥Î¬ö¿ý¤u§@ªíC1ªºÈ§@±ø¥ó
©Ò¥H¥un±N¬ö¿ý¤u§@ªíC1ªºÈ§ï¦¨·Qnªº¥N½X§Y¥i
§@ªÌ:
cfuxiong
®É¶¡:
2012-4-27 18:45
¦^´_
6#
c_c_lai
ÁÂÁÂc_c_laiªº«ü¾É»PÀ°¦£¡A«D±`º¡·N¡K¦A»¡ÁnÁÂÁÂ~~
§@ªÌ:
cfuxiong
®É¶¡:
2012-4-27 18:45
¦^´_
8#
Hsieh
ÁÂÁÂHsiehª©¤j²Ó¤ß«ü¾É¡F¤wOK¤F¡KÁÂÁÂ~~
§@ªÌ:
GBKEE
®É¶¡:
2012-4-27 21:05
¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-4-27 21:09 ½s¿è
¦^´_
10#
cfuxiong
¸Õ¸Õ¬Ý
Option Explicit '¦b¼Ò²Õ¼h¦¸¤¤±j¢¨CÓ¦b¼Ò²ÕùتºÅܼƳ£¥²¶·©ú½Tªº«Å§i¡C
Dim Rng As Range
Private Sub AUTO_OPEN() '¦¹¥¨¶°©óÀɮ׶}±Ò®É·|¦Û°Ê°õ¦æ
Sheets("¬ö¿ý").UsedRange.Offset(2).Clear '²M°£ «e¤@¤éªº¼Æ¾Ú
'*** Offset(1).Clear §ï¦¨ Offset(2).Clear '********
If Time < TimeValue("08:45") Then '¦©ó¶}½L®É¶¡
Application.OnTime TimeValue("08:45"), "MyDee" '³]©w©ó08:45 °õ¦æ MyDee µ{§Ç
ElseIf Time >= TimeValue("08:45") And Time <= TimeValue("13:30") Then '©ó¥æ©ö®É¶¡¤º
MyDee ' °õ¦æ MyDee µ{§Ç
End If
End Sub
Private Sub MyDee()
Dim Sh As Worksheet, ¥N¸¹ As String
If Time > TimeValue("13:30") Then Exit Sub ' ¦¬½L®É¶¡«á °±¤î°õ¦æ
On Error Resume Next
Set Sh = Sheets("¬ö¿ý")
With Sh
¥N¸¹ = .[C1]
.[C1].Select
.Activate
Application.ScreenUpdating = False
With Rng
.Interior.ColorIndex = xlNone
.Borders.LineStyle = xlLineStyleNone
End With
If Err <> 0 Then
Err.Clear
On Error GoTo 0
.UsedRange.Interior.ColorIndex = xlNone
.UsedRange.Borders.LineStyle = xlLineStyleNone
End If
End With
With Sheets("¶×¤J").QueryTables(1)
.Connection = "URL;http://tw.stock.yahoo.com/q/q?s=" & ¥N¸¹
.Refresh False
Application.EnableEvents = False
Set Rng = Sh.Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(1, .ResultRange.Columns.Count - 1)
Rng.Value = .ResultRange.Rows(3).Value
With Rng
If .Row >= 20 Then
ActiveWindow.ScrollRow = .Row - 17
Else
ActiveWindow.ScrollRow = 3
End If
.Interior.ColorIndex = 4
.BorderAround xlContinuous, 2, 5
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End With
Application.OnTime Now + TimeValue("00:00:10"), "MyDee" '³]©w 10¬í«á °õ¦æ MyDee µ{§Ç
'10¬íÄÁ: ¿é¤J¦¹®æ¦¡ #00:00:10# «áVBA ¦Û°Ê¥Í¦¨ -> #12:00:10 AM#
'5¤ÀÄÁ: ¿é¤J¦¹®æ¦¡ #00:05:00# «áVBA ¦Û°Ê¥Í¦¨ -> #12:05:00 AM#
'1¤p®É: ¿é¤J¦¹®æ¦¡ #1:00:00# «áVBA ¦Û°Ê¥Í¦¨ -> #1:00:00 AM#
'Application.OnTime Now + #12:00:10 AM#, "MyDee" '³]©w 10¬í«á °õ¦æ MyDee µ{§Ç
'Application.OnTime Now + #12:05:00 AM#, "MyDee" '³]©w 5¤ÀÄÁ«á °õ¦æ MyDee µ{§Ç
'Application.OnTime Now + #1:00:00 AM#, "MyDee" '³]©w 1¤p®É«á °õ¦æ MyDee µ{§Ç
Exit Sub
End Sub
½Æ»s¥N½X
§@ªÌ:
cfuxiong
®É¶¡:
2012-4-27 22:14
¦^´_
11#
GBKEE
GRKEEª©¤j±ß¦w¡F§Ú¬O·s¤â°ÝÃD¯S§O¦h¡F½Ð°Ý¶K¤WVBAµ{¦¡¤£ª¾¦p¦óÀx¦s~~~
§Ú¾Þ§@¦p¤U[¤u¨ã]¡÷[¥¨¶°] ¡÷[VB½s¿è¾¹] ¡÷¶K¤WVBAµ{¦¡=>n¦p¦óÀx¦s¡H
¯à§_«ü¾É¡HÁÂÁÂ~~
§@ªÌ:
c_c_lai
®É¶¡:
2012-4-27 23:02
¦^´_
12#
cfuxiong
¦^´_
11#
GBKEE
§Ú±N GBKEE ¤j¤jªºµ{¦¡ (µy¥[×¹¢) ©ñ¤J ªÑ²¼¬ö¿ý2¡A cfuxiong ¦Ñ§Ìªº©ñ¤J¨ì ªÑ²¼¬ö¿ý1 ¤¤¡A³Ì¥ýªºÀÉ®×·íµM¬O ªÑ²¼¬ö¿ý ¤F¡C
«e¨âªÌ³£¬O±Nµ{¦¡½X©ñ¸m¦b ThisWorkbook µ{¦¡°Ï¤º°õ¦æªº¡A ¦P®É C1 Äæ¦ì²§°ÊªºÀˬdµ{¦¡½X¤]¸òµÛ×¥¿ (쥻¬O "Module1.MyDee")¡A
' Sheet2 (¬ö¿ý) ªºµ{¦¡°Ï°ì
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target(1).Cells = [C1] Then Run "ThisWorkbook.MyDee"
End Sub
½Æ»s¥N½X
Ä@¨â¦ì¦³Ó´r§Öªº©P¦ì©]±ß¡I
[attach]10707[/attach]
[attach]10705[/attach]
[attach]10706[/attach]
§@ªÌ:
GBKEE
®É¶¡:
2012-4-28 06:39
¦^´_
12#
cfuxiong
ÀH³oExcel ¦sÀÉ´N¥i¥H¦sÀÉ ©Î ¶×¥X¦sÀÉ ¨ä¥L Excel ÀÉ®× ¥i¶×¤J¨Ï¥Î
¶i¤J VBA µøµ¡ ÁÙ¦³¤@³~®|
¦p¹Ï
[attach]10708[/attach] [attach]10709[/attach]
§@ªÌ:
c_c_lai
®É¶¡:
2012-4-28 07:23
¦^´_
14#
GBKEE
½Ð±Ð±z¡A¥N¸¹ = .[C1] ªº [C1] ¨ä¥»¨¦b©w¸q¤W«üªº¬O Range ÁÙ¬O Cells¡A ¥¦ÌÂà¥XÈ·|¬O Value ÁÙ¬O Text¡H
·íµM¦b³]©w®É¡A´N¤w«D±`²M·¡¸ÓÄ檺ÄÝ©Ê¡A §Ún¤F¸Ñªº¬O¥¦¦bÀ³¥Î±¤W¥¿½Tªº¨Ï¥Î¡C
Ä´¦p»¡¤§«e´£¹Lªº¡G¦pªG¸ÓÄæ¦ì¬O®É¶¡Äæ¡A¦ý¸ÓÄæ "A3" Àx¦sªº¬O "=TIME(LEFT(A2,LEN(A2)-4),MID(A2,LEN(A2)-3,2),RIGHT(A2,2))"
©Î¬O A3 ¬O Web ª½±µ¶×¤Jªº®É¶¡¡A¦ý¸ÓÄæ¦ì®æ¦¡¨Ã«D "®É¶¡"¡A¤]³\¬O "¦Ûq" ¤]»¡¤£©w¡A¨º»ò¦¹®É ®É¶¡ = .[A3]¡A
©Ò±o¨ìªºÈ·|¬O 0.604166667 ÁÙ¬O 14:30 (°²³]·í®É®É¶¡¬° 02:30:00 PM)¡H À³¸Ó¦p¦ó¥h°µ¥¿½Tªº«Å§i¡H
§@ªÌ:
GBKEE
®É¶¡:
2012-4-28 10:34
¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-4-28 10:37 ½s¿è
¦^´_
15#
c_c_lai
Option Explicit
Sub Ex()
'[xxx] 'xxx ¬°¬¡¶Ã¯ªºª«¥ó ©Î¨ç¼Æ ¦ý¤£¥i¥H¬OÅܼÆ
MsgBox [max({5,100,9})]
[¬ö¿ý!B3] = 0.666
[¬ö¿ý!B3].NumberFormatLocal = "h:mm;@"
MsgBox [¬ö¿ý!B3] '¶Ç¦^ªº¬OÈ .Value
MsgBox [¬ö¿ý!B3].Text '¶Ç¦^ªº¶Ç¦^Àx¦s®æªº®æ¦¡
'Rng.Value = .ResultRange.Rows(3).Value
'Rng ²Ä2Ó¦ì¸m¬O ¼ÆÈ ±N¥¦³]©w ¬°®É¶¡®æ¦¡
'Rng.Cells(2).NumberFormatLocal = "h:mm;@"
End Sub
½Æ»s¥N½X
§@ªÌ:
c_c_lai
®É¶¡:
2012-4-28 11:02
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-4-28 11:07 ½s¿è
¦^´_
16#
GBKEE
¸g´ú¸Õ²×©óÅé·|¤F¡A¦°_ªº³¾¨à¯uªº¦³ÂΦY¡I
Sub Ex()
' [xxx] 'xxx ¬°¬¡¶Ã¯ªºª«¥ó ©Î¨ç¼Æ ¦ý¤£¥i¥H¬OÅܼÆ
' MsgBox [max({5,100,9})]
[¤u§@ªí1!B3] = 0.666
[¤u§@ªí1!B3].NumberFormatLocal = "h:mm;@"
MsgBox [¤u§@ªí1!B3] '¶Ç¦^ªº¬OÈ .Value
0.666
MsgBox [¤u§@ªí1!B3].Text '¶Ç¦^ªº¶Ç¦^Àx¦s®æªº®æ¦¡
15:59
[¤u§@ªí1!B4] = [¤u§@ªí1!B3] '±a¤Jªº¬OÈ .Value
0.666
[¤u§@ªí1!B5] = [¤u§@ªí1!B3].Text '±a¤Jªº¬OÀx¦s®æªº®æ¦¡
15:59
'Rng.Value = .ResultRange.Rows(3).Value
'Rng ²Ä2Ó¦ì¸m¬O ¼ÆÈ ±N¥¦³]©w ¬°®É¶¡®æ¦¡
'Rng.Cells(2).NumberFormatLocal = "h:mm;@"
End Sub
§Ú±N
MsgBox [max({5,100,9})]
Marked¡Aµo²{¦n¹³µL§@¥Î¡A
½Ð°Ý¥¦¦³¦ó§@¥Î¡H
§@ªÌ:
GBKEE
®É¶¡:
2012-4-28 11:05
¦^´_
17#
c_c_lai
¨ú®øµù¸Ñ ¬Ý¬Ý
¬O»¡©ú [ ] ªº¥Îªk
§@ªÌ:
c_c_lai
®É¶¡:
2012-4-28 11:09
¦^´_
18#
GBKEE
ì¨Ó¬O¨ú¥X¨ä³Ì¤jÈ¡C
§@ªÌ:
cfuxiong
®É¶¡:
2012-4-28 16:50
¦^´_
17#
c_c_lai
Meadª©¤jc_c_laiª©¤j¡F§A̦n¡F
·PÁ¨â¦ì¥ý¶i¤ÏÂЫü¾É¡AÅý·s¤â½m²ß¡BÅé·|
¦A¦¸¦V¨â¦ì»¡Án "·P¿E¨â¦ì¥ý¶i"¡I
Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)