Page 1 of 1

ทำกราฟโชว์ที่Sheetหลัก (VBA)

Posted: Wed Apr 20, 2016 2:36 pm
by waangpa
:) ขอความช่วยเหลือหน่อยค่ะ คือว่าสร้างคำสั่งในVBA แล้วค่ะ แต่กราฟมันไม่โชว์ให้ค่ะ ต้องสร้างคำสั่งให้กราฟโชว์ที่Sheetหลัก ยังไงค่ะ (ขอบคุณมากค่ะ) ทำหลายรอบแล้วก็ไม่ได้สักทีค่ะ :cry:
test.xlsm
(33.13 KiB) Downloaded 28 times

Re: ทำกราฟโชว์ที่Sheetหลัก (VBA)

Posted: Wed Apr 20, 2016 8:12 pm
by snasui
:D ตัวอย่างการสร้าง Chart ในชีตหน้าหลักครับ

Code: Select all

Dim c As Object
For Each c In ActiveSheet.Shapes
    If Left(c.Name, 5) = "Chart" Then
        c.Delete
    End If
Next c
Sheets("หน้าหลัก").Shapes.AddChart.Select
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("กราฟ").Range("$B$3:$H$51")

Re: ทำกราฟโชว์ที่Sheetหลัก (VBA)

Posted: Fri Apr 22, 2016 10:19 am
by waangpa
ขอบคุณมากค่ะ อาจารย์