Option within Macro select wsheets when copying to a new Wbook

suttonutd

Board Regular
Joined
Oct 5, 2010
Messages
68
Hi, I currently have the script below to copy a wksheet to a New Workbook. R9096 is 1 of 35 reports and they have their own worksheet. I would like the user to have an option of selecting the reports they want to extract. Is this possible to do within a macro? Maybe a drop menu showing the worksheets? Or is there a simpler way?

Sub test1()
'
' test1 Macro
'


'
Sheets("R9096").Select
Sheets("R9096").Copy
ActiveWorkbook.BreakLink Name:= _
"C:\Users\philipss\Fremantle\Finance - IP - Improvement Projects\Producer Share\00 Digital Income Report - TEST NEW.xlsm" _
, Type:=xlExcelLinks
Range("H3:M7").Select
Selection.ClearContents
ActiveSheet.Buttons.Delete
Range("E3").Select
Dim wb As Workbook
Set wb = Application.ActiveWorkbook
If Not IsEmpty(wb.LinkSources(xlExcelLinks)) Then
For Each link In wb.LinkSources(xlExcelLinks)
wb.BreakLink link, xlLinkTypeExcelLinks
Next link
End If
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\philipss\Fremantle\Finance - IP - Improvement Projects\Producer Share\Export Files\test.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub

Thanks, Steve
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top