Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / June 2006

Tip: Looking for answers? Try searching our database.

Inputbox macro for multiple cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mcphc - 23 Jun 2006 10:21 GMT
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
Ardus Petus - 23 Jun 2006 10:39 GMT
dim myRange as Range
Set myRange = Application.InputBox(prompt := "Sample", type := 8)

HTH
--
AP

>I would like to write a macro that asks the user to select multiple cells
>on
[quoted text clipped - 9 lines]
>
> Clayton
Ardus Petus - 23 Jun 2006 10:50 GMT
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

> dim myRange as Range
> Set myRange = Application.InputBox(prompt := "Sample", type := 8)
[quoted text clipped - 16 lines]
>>
>> Clayton
NickHK - 23 Jun 2006 10:52 GMT
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

> 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
[quoted text clipped - 6 lines]
>
> Clayton
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.