snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Sub copychart()
Dim ws As Worksheet
Dim Chrt1 As ChartObject
Dim chrt2 As ChartObject
Dim chrt As Chart
Dim cht As ChartObject
' Worksheets("Chart").Activate
' ActiveSheet.ChartObjects.Delete
Set ws = Worksheets("Chart")
Set Chrt1 = Sheets("Main").ChartObjects(1)
Chrt1.Copy
ws.Paste Destination:=ws.Range("A1")
Set chrt2 = ws.ChartObjects(1)
With chrt2.Chart.Parent
.Height = 450
.Width = 1250
End With
With chrt2.Chart
With .Axes(xlCategory)
.TickLabels.Orientation = 90
.Legend.Position = xlLegendPositionBottom
End With
End With
With chrt2.Chart.Axes(xlValue)
.HasTitle = True
With .AxisTitle
.Caption = "บาท"
.Font.Name = "Arial"
.Font.Size = 16
End With
End With
End Sub
You do not have the required permissions to view the files attached to this post.
'Other code
With chrt2.Chart
.SetElement (msoElementLegendBottom)
With .Axes(xlCategory)
.TickLabels.Orientation = 90
'.Legend.Position = xlLegendPositionBottom
End With
End With
'Other code
'Other code
With chrt2.Chart
.SetElement (msoElementLegendBottom)
With .Axes(xlCategory)
.TickLabels.Orientation = 90
'.Legend.Position = xlLegendPositionBottom
End With
End With
'Other code