Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Inputbox macro for multiple cells

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

HTH
--
AP


"mcphc" a écrit dans le message de news:
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default 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" a écrit dans le message de news:
...
dim myRange as Range
Set myRange = Application.InputBox(prompt := "Sample", type := 8)

HTH
--
AP


"mcphc" a écrit dans le message de news:
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make a macro to clear multiple cells from multiple worksheets? [email protected] Excel Worksheet Functions 2 October 18th 07 04:31 PM
macro copy/paste data from multiple cells to multiple cells Diana Excel Discussion (Misc queries) 0 July 10th 06 09:24 PM
Inputbox macro for multiple cells mcphc Excel Discussion (Misc queries) 2 June 23rd 06 12:06 PM
Including an inputbox within a macro Drummy[_4_] Excel Programming 1 June 7th 06 07:18 AM
Help with InputBox in a Macro Lizz45ie[_6_] Excel Programming 3 October 28th 05 02:12 AM


All times are GMT +1. The time now is 06:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"