ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

excel VBA calculate ªººÃ°Ý

¦^´_ 29# GBKEE


¤j­ô
§Úı±oÀ³¸Ó¬ODDEªº°ÝÃD, À³¸Ó¤£¬Oµ{¦¡ªº°ÝÃD
¦]¬°§Y¨Ï¬O²{¦b§Ú¥´¶}ÀÉ®×
©Ò¦³¼Æ¦r³£¨S¦³§ïÅܪº±¡ªp¤§¤U(¤½¦¡·íµM¤]¨S¦³ÅÜ)
Ãö±¼ÀÉ®×
EXCEL³£·|¥X²{==> Àɮפw³Q­×§ï¹L, §A¬O§_­nÀx¦sÀɮתºmsgbox

©Ò¥H§Ú²q§Y¨Ï³£¨S¦³Åܪº±¡ªp¤§¤U
DDEÁÙ¬O¦³°Ê§@
§Ú²q¬O¤@¥´¶}ÀÉ®×
EXCEL´N·|¥h§ìDDEªº¸ê®Æ
©Ò¥H§Y¨Ï¼Æ¦r¨S¦³ÅÜ
¦ý¬O¹ïEXCEL¨Ó»¡
«o¬O­«·s§ìªº
excel VBA ¦nÃø³á...

TOP

¡ÕDDE¤u§@ªí¸ê®Æ¨Ò¡Ö
20130516-01.JPG

¡Õ¤u§@ªí¨Æ¥ó°Ï¡Dµ{¦¡½X¡Ö
Private Declare Function PlaceOrderVB Lib "TC_Excel_Addin.xll" (ByVal OrderInfo As String) As String
Option Explicit

Private Sub Worksheet_Calculate()
Dim tmpResult As String
Dim OrderInfo_1 As String
If Date Mod 7 - 1 > 5 Then Exit Sub ¡@¡@'¤µ¤Ñ¬°¡e©P¤»¡D©P¤é¡f«D¥æ©ö¤é¡D¸õ¥X
If Time < TimeValue("08:00:00") Then Exit Sub¡@ ¡@'¥¼¨ì¶}½L¡D¸õ¥X
If Time > TimeValue("13:45:00") Then Exit Sub¡@¡@ '¤w¹L¦¬½L¡D¸õ¥X
If [D5] = "¤w°e³æ" And [D6] = Date Then Exit Sub ¡@¡@'¤µ¤Ñ¤w¦³°e³æ°O¿ý¡D¸õ¥X
If IsError([D4]) Then Exit Sub ¡@¡@ 'DDE¥¼¥¿½T³sµ²¡A©Î¤½¦¡¦³»~¡D¸õ¥X
If Val([D4]) < 0 Then Exit Sub ¡@¡@'¥¼¹F¥Ø¼Ð»ù¡D¸õ¥X
On Error GoTo 901 ¡@¡@¡@'µ{¦¡°õ¦æ¿ù»~®É¡A±j¨î¸õ¦Ü901¦æ¡A¥H¦^´_¨Æ¥óIJµo¡A¨Ã¸õ¥X
'-------------------------------------------
Application.EnableEvents = False
OrderInfo_1 = "" ' ¸Ì­±¬O­Ó¸ê, ¤U³æªº³]©w
tmpResult = PlaceOrderVB(OrderInfo_1)
PlaceOrderVB (OrderInfo_1)
[D5] = "¤w°e³æ"¡@'°e³æ°T®§
[D6] = Date¡@¡@'°e³æ¤é´Á
[D7] = Time¡@¡@'°e³æ®É¶¡
901: Application.EnableEvents = True
End Sub

¡Õ³Æµù¡Ö
¥H¤u§@ªí¨Æ¥ó¶i¦æDDE°ÊºAºÊµø¡A¨Ã¤£¤Ó¦n´x±±¡A¤§«e¦³¼g¹L´X­Ó½d¨Ò¡A¬O¥H¡e¨C¬í¡f»¼°j¥Dµ{¦¡ºÊµø¤Î°O¿ý¼Æ¾Ú¡A
¥i¦Ü±Í³¡¸¨®æ¡A©Îºô­¶·j´MÃöÁä¦r¡e­ã´£³¡ªL ª÷¤d¨½ DDE¡f°Ñ¦Ò¬ÛÃö¤U¸üÀÉ¡]µ{¦¡½X¤½¶}¡A¥B¦³µù¸Ñ¡^¡A
­Ó¤H¨ÃµL¾Þ§@ªÑ²¼¤Î¨ä¥¦ª÷¿Ä°Ó«~¡A¤]±q¥¼¨Ï¥Î¹LDDE¡A¶È¾Ì´¢ºN¼gµ{¦¡¡A©Ò¥H½Ð¦Û¦æ®M¥Î¡AµLªk°µ¨p¤HªºªA°È¡C
º¸«á­Y¦³®É¶¡¡D©Î³\¤]¦b³o½×¾Â«Ø­Ó¡e¦Û°Ê°O¿ýDDE¡fÃD¤À¨É¡I

¥H¤W¯Â¦]ª©¥D¤@¥y¡eVBA¦nÃø¡f¡AÀ³½t¦Óµo¡I¡@¯¬¡@¾Þ§@¶¶§Q

TOP

        ÀR«ä¦Û¦b : ®É®É¦n¤ß´N¬O®É®É¦n¤é¡C
ªð¦^¦Cªí ¤W¤@¥DÃD