codesearcher
Technical User
Hi All,
I have a requirement, For the given excel sheet i have to apply drill down functionality and deliver as output. Along with filter and freezing pane. Am now ready with freezing pane and filter's can i get help to implement drill option in excel through vbscript?
Code used:
Sub Test()
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("D:\Test\Distributor.xlsx")
objExcel.Application.Visible = True
objExcel.ActiveWorkbook.Sheets("Sheet1").Range("12:12").Select
objExcel.ActiveWindow.FreezePanes = True
objExcel.ActiveWorkbook.Sheets("Sheet1").Activate
objExcel.ActiveWorkbook.Sheets("Sheet1").Cells(1, 1) = "H111i"
objExcel.ActiveWorkbook.Sheets("Sheet1").AutoFilterMode = False
objExcel.ActiveWorkbook.Sheets("Sheet1").Range("A1:B1").AutoFilter
'This is to create a new group - Row Level.
objExcel.ActiveWorkbook.Sheets("Sheet1").Range("1:1").EntireRow.Group
'objExcel.ActiveWorkbook.Sheets("Sheet1").Range("4:6").EntireRow.Group
'This is to create a new group - Column Level.
'objExcel.ActiveWorkbook.Sheets("Sheet1").Range("B:B").EntireColumn.Group
'objExcel.ActiveWorkbook.Sheets("Sheet1").Range("C").EntireColumn.Group
'This is to show the details on particular levels.
'objExcel.ActiveWorkbook.Sheets("Sheet1").Outline.ShowLevels RowLevels:=2
objExcel.ActiveWorkbook.Save
'objExcel.ActiveWorkbook.Close
'objExcel.Application.Quit
End Sub
I have a requirement, For the given excel sheet i have to apply drill down functionality and deliver as output. Along with filter and freezing pane. Am now ready with freezing pane and filter's can i get help to implement drill option in excel through vbscript?
Code used:
Sub Test()
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("D:\Test\Distributor.xlsx")
objExcel.Application.Visible = True
objExcel.ActiveWorkbook.Sheets("Sheet1").Range("12:12").Select
objExcel.ActiveWindow.FreezePanes = True
objExcel.ActiveWorkbook.Sheets("Sheet1").Activate
objExcel.ActiveWorkbook.Sheets("Sheet1").Cells(1, 1) = "H111i"
objExcel.ActiveWorkbook.Sheets("Sheet1").AutoFilterMode = False
objExcel.ActiveWorkbook.Sheets("Sheet1").Range("A1:B1").AutoFilter
'This is to create a new group - Row Level.
objExcel.ActiveWorkbook.Sheets("Sheet1").Range("1:1").EntireRow.Group
'objExcel.ActiveWorkbook.Sheets("Sheet1").Range("4:6").EntireRow.Group
'This is to create a new group - Column Level.
'objExcel.ActiveWorkbook.Sheets("Sheet1").Range("B:B").EntireColumn.Group
'objExcel.ActiveWorkbook.Sheets("Sheet1").Range("C").EntireColumn.Group
'This is to show the details on particular levels.
'objExcel.ActiveWorkbook.Sheets("Sheet1").Outline.ShowLevels RowLevels:=2
objExcel.ActiveWorkbook.Save
'objExcel.ActiveWorkbook.Close
'objExcel.Application.Quit
End Sub