Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Format a Range of CellsContent of Format a Range of Cells.vbsMD5 Hash: 44F7659C27734B2B862A60AB6B08F250 |
||
' Description: Demonstration script that adds data to four different cells in a spreadsheet, then uses the Range object to format multiple cells at the same time.
Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.Workbooks.Add objExcel.Cells(1, 1).Value = "Name" objExcel.Cells(1, 1).Font.Bold = TRUE objExcel.Cells(1, 1).Interior.ColorIndex = 30 objExcel.Cells(1, 1).Font.ColorIndex = 2 objExcel.Cells(2, 1).Value = "Test value 1" objExcel.Cells(3, 1).Value = "Test value 2" objExcel.Cells(4, 1).Value = "Tets value 3" objExcel.Cells(5, 1).Value = "Test value 4" Set objRange = objExcel.Range("A1","A5") objRange.Font.Size = 14 Set objRange = objExcel.Range("A2","A5") objRange.Interior.ColorIndex = 36 Set objRange = objExcel.ActiveCell.EntireColumn objRange.AutoFit() | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |