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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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