+ Reply to Thread
Results 1 to 4 of 4

Inputbox macro for multiple cells

Hybrid View

Guest Inputbox macro for multiple... 06-23-2006, 05:25 AM
Guest Re: Inputbox macro for... 06-23-2006, 05:45 AM
Guest Re: Inputbox macro for... 06-23-2006, 05:55 AM
Guest Re: Inputbox macro for... 06-23-2006, 06:00 AM
  1. #1
    mcphc
    Guest

    Inputbox macro for multiple cells

    I would like to write a macro that asks the user to select multiple cells on
    a sheet (i.e. D10,AK13,AG16,V19) using an InputBox or similar. Then I would
    like the macro to cycle through each of the cells using the cell contents as
    a string in some other statements.

    Is this possible?

    Thanks

    Clayton

  2. #2
    Ardus Petus
    Guest

    Re: Inputbox macro for multiple cells

    dim myRange as Range
    Set myRange = Application.InputBox(prompt := "Sample", type := 8)

    HTH
    --
    AP


    "mcphc" <mcphc@discussions.microsoft.com> a écrit dans le message de news:
    6FDE54A9-1EF2-4E59-A3E6-47C9847243A4@microsoft.com...
    >I would like to write a macro that asks the user to select multiple cells
    >on
    > a sheet (i.e. D10,AK13,AG16,V19) using an InputBox or similar. Then I
    > would
    > like the macro to cycle through each of the cells using the cell contents
    > as
    > a string in some other statements.
    >
    > Is this possible?
    >
    > Thanks
    >
    > Clayton




  3. #3
    Ardus Petus
    Guest

    Re: Inputbox macro for multiple cells

    To browse thru multiple cells input:

    '-------------------------------------------------------
    dim myRange as Range
    dim rCell as Range

    Set myRange = Application.InputBox(prompt := "Sample", type := 8)
    For each rCell in myRange

    Next rCell
    '---------------------------------------------------------

    HTH
    --
    AP


    "Ardus Petus" <ardus.petus@laposte.net> a écrit dans le message de news:
    %23nQeLjqlGHA.2392@TK2MSFTNGP04.phx.gbl...
    > dim myRange as Range
    > Set myRange = Application.InputBox(prompt := "Sample", type := 8)
    >
    > HTH
    > --
    > AP
    >
    >
    > "mcphc" <mcphc@discussions.microsoft.com> a écrit dans le message de news:
    > 6FDE54A9-1EF2-4E59-A3E6-47C9847243A4@microsoft.com...
    >>I would like to write a macro that asks the user to select multiple cells
    >>on
    >> a sheet (i.e. D10,AK13,AG16,V19) using an InputBox or similar. Then I
    >> would
    >> like the macro to cycle through each of the cells using the cell contents
    >> as
    >> a string in some other statements.
    >>
    >> Is this possible?
    >>
    >> Thanks
    >>
    >> Clayton

    >
    >




  4. #4
    NickHK
    Guest

    Re: Inputbox macro for multiple cells

    Clayton,
    Or for multiple selections:
    Dim rng As Range
    Dim Counter As Long
    Dim Ranges() As String 'Or use an array of ranges

    On Error Resume Next

    Do
    Set rng = Application.InputBox("Select a range, then click OK.", "Range
    selection", , , , , , 8)
    If Err.Number > 0 Then Exit Do
    Counter = Counter + 1
    ReDim Preserve Ranges(1 To Counter)
    Ranges(Counter) = rng.Address
    Loop

    NickHK

    "mcphc" <mcphc@discussions.microsoft.com> wrote in message
    news:6FDE54A9-1EF2-4E59-A3E6-47C9847243A4@microsoft.com...
    > I would like to write a macro that asks the user to select multiple cells

    on
    > a sheet (i.e. D10,AK13,AG16,V19) using an InputBox or similar. Then I

    would
    > like the macro to cycle through each of the cells using the cell contents

    as
    > a string in some other statements.
    >
    > Is this possible?
    >
    > Thanks
    >
    > Clayton




+ 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