Loop through multiple listBox selections and export to Excel
I am trying to write a macro that will loop through multiple reports per region selection and export each report to excel. I loaded (Inline) the Report Names and corresponding object codes into the application to facilitate, however I cannot seem to get the code to
Loop properly through the various selections:
The first region selected seems to work - I get a tab per each report I selected, but when the code moves to the second region selected it continues to export ALL the reports (regardless of the report name selection).
Can anyone point me in the right direction?
set doc= ActiveDocument
set docprop = doc.GetProperties
set appExcel = CreateObject("Excel.Application")
appExcel.Visible = True
set RptReg = ActiveDocument.Fields("ReportingRegion").GetPossibleValues