Macro - providing user with choices

gossv

Board Regular
Joined
Jul 8, 2005
Messages
141
Hi,

I would like to move or copy a worksheet into a new book and give the user a choice on which book to move it into and what to rename the worksheet.

This is my macro and the "......." parts is where I would like it to allow the suer to choose.

Can someone please help me.

Thank you


Sheets("BC Report").Select
Sheets("BC Report").Copy Before:=Workbooks("..............."). _
Sheets(1)
Range("A1:G48").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("BC Report").Select
Range("A1").Select
Sheets("BC Report").Select
Sheets("BC Report").Name = "............."
Range("A1").Select
 

Some videos you may like

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi

Do you want the choice to just be from currently open workbooks, or would you like the user to have a choice of closed ones too (ie ones currently sat on a netwrok drive for instance)?


EDIT: a very simple option would be to get your users to type in the workbook name into an InputBox, but I was thinking more along the lines of selecting the file itself or the name of an open file from a list. This does increase the complexity somewhat, however.

An input box could be as simple as:

Code:
Dim strWB as String, wb As Workbook
strWB = InputBox("Enter Workbook Name")
If strWB<>"" Then
  On Error Resume Next
  Set wb = Workbooks(strWB)
  On Error Goto 0
  If Not wb Is Nothing Then _
    Sheets("BC Report").Copy Before:=wb.Sheets(1)
End If
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,122,948
Messages
5,599,016
Members
414,273
Latest member
vikas007

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
Top