Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Macro to delete a group of CELLS | Excel Discussion (Misc queries) | |||
Cells turn 'hot' and execute distant macro button | Excel Discussion (Misc queries) | |||
Macro to copy cells to rows below | Excel Discussion (Misc queries) | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions |