Hi,
I am able to run my VBA code smoothly. However, I am not sure how to paste them as values and keep the source formatting.
I appreciate your help in advanced!
I am able to run my VBA code smoothly. However, I am not sure how to paste them as values and keep the source formatting.
VBA Code:
Sub ExportWorksheets()
Dim wbSource As Workbook, wbTarget As Workbook
Dim worksheetList As String
Dim worksheetArr As Variant
Dim arrIndx As Long
worksheetList = "GOOGL:TSLA"
worksheetArr = Split(worksheetList, ":")
If UBound(worksheetArr) = -1 Then Exit Sub
Set wbSource = ThisWorkbook
Set wbTarget = Workbooks.Add
For arrIndx = LBound(worksheetArr) To UBound(worksheetArr)
ThisWorkbook.Worksheets(worksheetArr(arrIndx)).Copy wbTarget.Worksheets(wbTarget.Worksheets.Count)
Next arrIndx
MsgBox "Export complete.", vbInformation
CleanObjects:
Set wbTarget = Nothing
Set wbSource = Nothing
End Sub
I appreciate your help in advanced!