Clear code:
Dim ctl As Control
'Remove all text box contents
For Each ctl In Controls
If TypeOf ctl Is TextBox Then ctl.Text = ""
Next ctl
'Remove all combobox text box contents
For Each ctl In Controls
If TypeOf ctl Is ComboBox Then ctl. Text = ""
Next ctl
Export Excel code:
Dim xlApp As Excel.Application
Dim xlBpp As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = New Excel.Application 'Create a reference to
xlApp Set xlApp = CreateObject("Excel.application") 'Create an Excel object
Set xlBook = xlApp. Workbooks.Add 'Add workbook
xlApp.SheetsInNewWorkbook = 1 'Set the number of open worksheets
xlApp.Visible = True 'Set Excel visible
xlApp.Caption = "Charge amount"
xlApp.ActiveSheet.Cells(i, j).Value = "" 'Assign a value to a cell in the active worksheet