// 新規ワークブックの作成 var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; var range = worksheet.Range["A5:B7, C3, H5:N6"]; // 範囲に色を設定 var area1 = worksheet.Range["A5:B7, C3, H5:N6"].Areas[0]; area1.Interior.Color = Color.Pink; // 範囲に色を設定 var area2 = worksheet.Range["A5:B7, C3, H5:N6"].Areas[1]; area2.Interior.Color = Color.LightGreen; // 範囲に色を設定 var area3 = worksheet.Range["A5:B7, C3, H5:N6"].Areas[2]; area3.Interior.Color = Color.LightBlue; // xlsx ファイルに保存 workbook.Save("AccessEachAreaOfRange.xlsx");
' 新規ワークブックの作成 Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim range = worksheet.Range("A5:B7, C3, H5:N6") ' 範囲に色を設定 Dim area1 = worksheet.Range("A5:B7, C3, H5:N6").Areas(0) area1.Interior.Color = Color.Pink ' 範囲に色を設定 Dim area2 = worksheet.Range("A5:B7, C3, H5:N6").Areas(1) area2.Interior.Color = Color.LightGreen ' 範囲に色を設定 Dim area3 = worksheet.Range("A5:B7, C3, H5:N6").Areas(2) area3.Interior.Color = Color.LightBlue ' xlsx ファイルに保存 workbook.Save("AccessEachAreaOfRange.xlsx")