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

[µo°Ý] Åý¨C¦¸·s²£¥ÍªºShape.name ¯à¥H¶¶§Ç©R¦W

¹Ïªí©R¦W

¦U¦ì¤j¤j ²{¦b¬O³o¼Ë
¨C·í§Ú«ö¤@¤U ²£¥Í·s¹Ï®×ªº®É«á¡A¦b¦WºÙ¤W excel ¦Û°Ê©R¦W¬° ¹Ïªí1¡A ¤U¦¸¦A©I¥sªº®É«á·|¦Û°ÊÅܦ¨¹Ïªí2
¯à§_¦b©I¥s¹Ïªíªº®É«á¡A´N©w¸q¥Lªº¦W¦r©O?
§Ú¸Õ¹L¤U¦Cµ{¦¡½X ³£¤£¦æ
=================
Private Sub CommandButton1_Click()
With ActiveSheet.ChartObjects.Add _
        (Left:=100, Width:=375, Top:=75, Height:=225)
    With .Chart
        .ChartType = xlXYScatterLines
        .SetSourceData Source:=Sheets("Sheet1").Range("F6:J7")
        .Parent.Name = "Name of this Chart"
    End With
End With
End Sub
==========================
charts.add
ActiveSheet.Chart.name="test"
===========================
Charts.name="test"
=============
³£¤£¦æ¡A ½Ð¦n¤ß¤H¤hÀ°¦£¸Ñµª ÁÂÁÂ

TOP

¦^´_ 1# kerochen
  1. Option Explicit
  2. Private Sub CommandButton1_Click()
  3.     Dim i As Integer
  4.     With ActiveSheet
  5.         i = .ChartObjects.Count
  6.         With .ChartObjects.Add(Left:=100, Width:=375, Top:=75, Height:=225).Chart
  7.             .ChartType = xlXYScatterLines
  8.             .SetSourceData Source:=Sheets("Sheet1").Range("F6:J7")
  9.             .Parent.Name = "Name of this Chart " & i + 1
  10.         End With
  11.         MsgBox .ChartObjects(ChartObjects.Count).Name
  12.         .ChartObjects("Name of this Chart " & i + 1).Select
  13.     End With
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

[µo°Ý] Åý¨C¦¸·s²£¥ÍªºShape.name ¯à¥H¶¶§Ç©R¦W

Hi °ª¤â­Ì¡AºÃ°Ý¦p¤U, ·í«ö¤UButton®É, ·|¤@¦¸Åª¨ú³o15­ÓÄæ¦ì¨Ã¦P®É²£¥Í15­Óshape, ¦Ó§Ú¶·­n¤À§O©R¦W1A¡B2A....¨ì15A, ¦Ó·í§Ú²M°£³o15­Óshape¤§«á, ¦A¦¸­«·s²£¥Í15­ÓShape ®É, ¦WºÙ¤]¬O¤@¼Ë¬O±q1A.¡B2A.¨ì15A... ½Ð°ª¤â«ü¾É¤@¤U. ÁÂÁÂ.

Private Sub commandbutton

pos=15
for index 3 to 7
for indexb = 6 to 10
dim second as double
second=val(cells(index + 1, indexb).value)
dim text as string
text=cells(index,indexb).value
call drwa(second,text,pos)
next
next
end sub
Public sub------------
activesheet.shapes.addshape(msoshaperectangle,shape_left,shape_top,sec*5.1,30).select
selection.name="1A"

¦^´_ 2# GBKEE


   ·PÁ¦^´_!

TOP

¦^´_ 1# kerochen

Index ¬OVBAªºÃöÁä¦r,ÅܼƦWºÙ¤£­n¥Î¨ì.  
  1. pos = 15
  2. For Index = 3 To 7  '7-3= 4 + 1  ­n¶]5¦¸
  3.     For indexb = 6 To 10  '10-6= 4 + 1  ­n¶]5¦¸
  4.     ' 5 * 5  ­n¶]25¦¸ °j°é
½Æ»s¥N½X
½ÐªþÀɬݬÝ
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 3# kerochen


for index 3 to 7 step 2  ¡÷ À³¬°¡e¢µ¦C¢´Äæ¡f¡A¤@¦¸Åª¡e¤W¤U¡f®æ¡@

¡eIndex¡@Second¡@Text¡f¬Ò¬°VBA¤º«Ø¦r½X(ÄÝ©Ê¡D¤èªk¡D¨ç¼Æ¡D±`¼Æ)¡A¤£­n³]¬°¡eÅܼơf¡A¥H§K³y¦¨¿ù»~¡I¡@

TOP

¤F¸Ñ, §Ú«Ý·|ªþÀɤW¨Ó. ÁÂÁ¤G¦ì¤j¤j.

TOP

        ÀR«ä¦Û¦b : ¥Ç¿ù¥XÄb®¬¤ß¡A¤~¯à²M²bµL·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD