Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
mcphc
 
Posts: n/a
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.misc
Vincnet.
 
Posts: n/a
Default Inputbox macro for multiple cells

Yep, it is!
Something like that:

Sub t()
Dim r As Range
Dim c As Range
Set r = Application.InputBox("Select cell(s)", "Demo", , , , , , 8)
r.Select
For Each c In r.Cells
' do whatever u need
Next c
End Sub


(application before inputbox allows you to define the type of inputbox, and
when Type is 8, InputBox returns a Range object)


Does it help?
--
KR

V.


"mcphc" wrote:

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.misc
mcphc
 
Posts: n/a
Default Inputbox macro for multiple cells

Perfect!

"Vincnet." wrote:

Yep, it is!
Something like that:

Sub t()
Dim r As Range
Dim c As Range
Set r = Application.InputBox("Select cell(s)", "Demo", , , , , , 8)
r.Select
For Each c In r.Cells
' do whatever u need
Next c
End Sub


(application before inputbox allows you to define the type of inputbox, and
when Type is 8, InputBox returns a Range object)


Does it help?
--
KR

V.


"mcphc" wrote:

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
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Macro to delete a group of CELLS Excel Discussion (Misc queries) 4 May 8th 06 04:29 PM
Cells turn 'hot' and execute distant macro button Kevryl Excel Discussion (Misc queries) 1 March 31st 06 02:08 PM
Macro to copy cells to rows below [email protected] Excel Discussion (Misc queries) 1 January 20th 06 06:59 PM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM


All times are GMT +1. The time now is 05:31 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"