- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-5-8 21:31 ½s¿è
¦^´_ 6# stillfish00 - Evaluate ¤èªk
- ½Ð°Ñ¾\®M¥Î¦Ü½d¨Ò¯S©w±N Microsoft Excel ¦WºÙÂà´«¦¨ª«¥ó©ÎªÌÈ¡C
- expression.Evaluate (Name)
- expression ¹ï©ó¿ï¾Ü©Êªº Application ª«¥ó¡A¹ï©ó¥²¿ïªº Chart ª«¥ó¡ADialogSheet ª«¥ó¡A©M Worksheet ª«¥ó¡C¶Ç¦^ [®M¥Î©ó] ²M³æ¤¤ªºª«¥óªº¹Bºâ¦¡¡C
- Name ¥²¿ïªº String¡Cª«¥ó¦WºÙ¡A¨Ï¥Î Microsoft Excel ªº©R¦WÂà´«¡C
- ³Æµù
- ¤U¦C´XÃþ Microsoft Excel ¦WºÙ¥i¥H¨Ï¥Î¦¹¤èªk¡G
- A1 ¼Ë¦¡ªº°Ñ·Ó¡C¥i¥H A1 ¼Ë¦¡ªº°O¸¹¦C¥X¹ï¥ô·Nªº³æÓÀx¦s®æªº°Ñ·Ó¡C©Ò¦³ªº°Ñ·Ó³£·í¦¨µ´¹ï°Ñ·Ó¡C
- ½d³ò¡C±z¥i¥H¨Ï¥Î½d³ò¡B¥æ¤e½d³ò©M¦h«½d³ò¡A¨Ï¥Îªº¹Bºâ¤l¤À§O¬°«_¸¹¡BªÅ¥Õ¤Î³r¸¹¡C
- ¤w©w¸qªº¦WºÙ¡C±z¥i¥H«ü©w¥¨¶°»y¨¥¤¤¥ô¦ó¦WºÙ¡C
- ¥~³¡°Ñ·Ó¡C¥i¥H¨Ï¥Î ! ¹Bºâ¤l°Ñ·Ó¥t¤@¬¡¶Ã¯¤WªºÀx¦s®æ©Î¤w©w¸qªº¦WºÙ¡C¨Ò¦p¡AEvaluate("[BOOK1.XLS]Sheet1!A1")¡C
- PS: ***--¥~³¡°Ñ·Ó¡C [BOOK1.XLS] ¶·¬O¶}±Òªº -***-'¥~³¡°Ñ·Ó¨ì ¥¼¶}±ÒªºÀɮ׶Ǧ^¿ù»~
- ªþµù ¨Ï¥Î¤è¬A¸¹ (¨Ò¦p, A1:C5) »P¥Î¦r¦ê¤Þ¼Æ©I¥s Evaluate ¤èªk¬Oµ¥®Äªº¡C¨Ò¦p¡A¤U¦C¹Bºâ¦¡¹ï¬Oµ¥»ùªº¡C
½Æ»s¥N½X- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim s
- If Target.Address = "$A$1" Then
- s = Dir(ThisWorkbook.Path & "\" & [A1] & "*")
- If s <> "" Then
- Application.EnableEvents = False
-
- '[A2] ¤½¦¡ 1
- [A2] = "='" & ThisWorkbook.Path & "\[" & s & "]RR'!$B$10 *2"
- '[A2] = "='" & ThisWorkbook.Path & "\[" & s & "]RR'!$B$10+'" & ThisWorkbook.Path & "\[" & s & "]RR'!$B$10"
-
- '[A2] ¤½¦¡ 2
- 'Names.Add Name:="AAA", RefersTo:="='" & ThisWorkbook.Path & "\[" & s & "]RR'!$B$10"
- '[A2] = "=AAA*2" '"=AAA+AAA"
- '[A4] = Evaluate("AAA") '¶Ç¦^¿ù»~È
- [A2] = [A2].Value '¤½¦¡Âର¼ÆÈ
- Application.EnableEvents = True
- Else
- MsgBox "File Not Found!"
- End If
- End If
- End Sub
½Æ»s¥N½X |
|