Here's a script that writes a column header to columns A, B,
and C, then inserts a new, blank column between columns B and C:
Steps:
Create an object for excel application
Assign the visible property as true
Assign the worksheet using workbooks object
Assign the data to
cells using work sheet methods
Using insert method insert data by specifying
Const xlShiftToRight = -4161
Ans:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Cells(1,1) = "Dataset 1"
objWorksheet.Cells(1,2) = "Dataset 2"
objWorksheet.Cells(1,3) = "Dataset 4"
Set objRange = objExcel.Range("C1").EntireColumn
objRange.Insert(xlShiftToRight)
SUBSCRIBE YOUTUBE CHANNEL FOR LATEST VIDEOS
https://www.youtube.com/channel/UC1EmncBu2maDiHNMNNqxw9g
SUBSCRIBE YOUTUBE CHANNEL FOR LATEST VIDEOS
https://www.youtube.com/channel/UC1EmncBu2maDiHNMNNqxw9g
No comments:
Post a Comment