|
とりあえずこんなものを作ってみました。
新しいシートでお試しください。
Option Base 1
Sub data()
Dim Dat_arr(6, 6)
Dat_arr(1, 3) = "東京": Dat_arr(1, 5) = "神奈川"
Dat_arr(2, 3) = "目黒区": Dat_arr(2, 4) = "品川区"
Dat_arr(2, 5) = "横浜市": Dat_arr(2, 6) = "川崎市"
Dat_arr(3, 1) = "3月1日": Dat_arr(5, 1) = "3月2日"
Dat_arr(3, 2) = "東京": Dat_arr(4, 2) = "神奈川"
Dat_arr(5, 2) = "東京": Dat_arr(6, 2) = "神奈川"
Dat_arr(3, 3) = "12456": Dat_arr(3, 4) = "45685"
Dat_arr(4, 5) = "45687": Dat_arr(4, 6) = "45685"
Dat_arr(5, 3) = "45687": Dat_arr(5, 4) = "87865"
Dat_arr(6, 5) = "45687": Dat_arr(6, 6) = "45657"
Cells(1, 1).Resize(6, 6) = Dat_arr
End Sub
'=========================================================
Sub sample()
Dim rn As Range, Co As Object
Set rn = Cells(1, 1).Resize(6, 6)
Set Co = ActiveSheet.ChartObjects.Add(60, 100, 400, 250)
With Co.Chart
.ChartType = xlColumnStacked
.SetSourceData Source:=rn, PlotBy:=xlColumns
End With
End Sub
|
|