+ Reply to Thread
Results 1 to 3 of 3

Define array of sheets by inputbox

  1. #1
    Herman
    Guest

    Define array of sheets by inputbox

    Hello
    I'm editing a procedure to copy certain sheets TOGETHER from Workbook
    A to Workbook B.
    In book A the user will be asked to click his way to book B. I know
    how to do that.
    But with book B activated an inputbox should prompt for the sheets to
    be copied together (selecting while holding the Ctrl key down). I
    think this should be done by an array input (type 64) but I can't
    figure it out.
    Can anyone help me here?
    Thank you very much.
    Herman

  2. #2
    Tom Ogilvy
    Guest

    Re: Define array of sheets by inputbox

    The application.InputBox will allow selection of ranges, but it won't
    support selecting sheets.

    You can put up a userform with a listbox (set for multiselect) or separate
    checkboxes with the sheets listed and let the user select from there.

    --
    Regards,
    Tom Ogilvy

    "Herman" <[email protected]> wrote in message
    news:[email protected]...
    > Hello
    > I'm editing a procedure to copy certain sheets TOGETHER from Workbook
    > A to Workbook B.
    > In book A the user will be asked to click his way to book B. I know
    > how to do that.
    > But with book B activated an inputbox should prompt for the sheets to
    > be copied together (selecting while holding the Ctrl key down). I
    > think this should be done by an array input (type 64) but I can't
    > figure it out.
    > Can anyone help me here?
    > Thank you very much.
    > Herman




  3. #3
    Dave Peterson
    Guest

    Re: Define array of sheets by inputbox

    Another option is to weasel and just have the user select the sheets first
    before invoking your code:

    Option Explicit
    Sub testme01()

    Dim resp As Long

    If ActiveWindow.SelectedSheets.Count = 1 Then
    resp = MsgBox(prompt:="You only have one sheet selected." _
    & vbLf & "Do you want to continue?", _
    Buttons:=vbYesNo)
    If resp = vbNo Then
    MsgBox "Please Group multiple sheets and try again"
    Exit Sub
    End If
    End If

    ActiveWindow.SelectedSheets.Copy _
    before:=Workbooks("otherworkbook.xls").Worksheets(1)

    End Sub


    Herman wrote:
    >
    > Hello
    > I'm editing a procedure to copy certain sheets TOGETHER from Workbook
    > A to Workbook B.
    > In book A the user will be asked to click his way to book B. I know
    > how to do that.
    > But with book B activated an inputbox should prompt for the sheets to
    > be copied together (selecting while holding the Ctrl key down). I
    > think this should be done by an array input (type 64) but I can't
    > figure it out.
    > Can anyone help me here?
    > Thank you very much.
    > Herman


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1