This is for my VB6 project.
I'm exporting Multiple MSFlefgrid into Excel on multiple sheets inside the same excel file with below code:
Dim xlObject As EXCEL.Application
Dim xlWB As EXCEL.Workbook
Dim r As Long
Set xlObject = New EXCEL.Application
'This Adds a new woorkbook, you could open the workbook from file also
Set xlWB = xlObject.Workbooks.Add
Clipboard.clear 'Clear the Clipboard
'Select Full Contents (You could also select partial content)
.Col = 0 'From first column
.Row = 0 'From first Row (header)
.ColSel = .Cols - 1 'Select all columns
.RowSel = .Rows - 1 'Select all rows
Clipboard.SetText .Clip 'Send to Clipboard
xlObject.ActiveWorkbook.ActiveSheet.Columns("A:V").HorizontalAlignment = xlLeft
xlObject.ActiveWorkbook.ActiveSheet.Columns("A:V").NumberFormat = "@"
xlObject.ActiveWorkbook.ActiveSheet.Range("a3") = "Load result:"
xlObject.ActiveWorkbook.ActiveSheet.Range("a3").Font.Bold = True
xlObject.ActiveWorkbook.ActiveSheet.Range("B3") = Format(Date, "mmm dd, yyyy")
xlObject.ActiveWorkbook.ActiveSheet.Range("b3").Font.Bold = True
xlObject.ActiveWorkbook.ActiveSheet.Range("D5").NumberFormat = "0"
.Range("A6").Select 'Select Cell A1 (will paste from here, to different cells)
.Paste 'Paste clipboard content
Once done will all sheets created, i would like to sort all sheets in a specific sequence.
How can i do that ?
Can i edit the code to select all the names sequence to be sorted?
If i says sheet3, sheet8, sheet13, sheets2... That would be my sequencing.
Thanks again for your help