Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Asking for a group of cells

I'm looking for an instruction to be used into a macro which gives the
possibility to interrupt the macro until you select a group of cells
with the mouse. Then the macro has to perform some operations on the
selected cells.
I tried with InputBox but it does not permit to select a range of
cells with the mouse, you can only write it with the keyboard, for
example: "a1:a10".
Could you suggest me something about this problem? I would like some
windows like the ones you use when you select data for a graphic.
Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Asking for a group of cells

use Application.Inputbox
with the Type parameter set to 8 , range.
read help on this, its reasonable good

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I'm looking for an instruction to be used into a macro

which gives the
possibility to interrupt the macro until you select a

group of cells
with the mouse. Then the macro has to perform some

operations on the
selected cells.
I tried with InputBox but it does not permit to select a

range of
cells with the mouse, you can only write it with the

keyboard, for
example: "a1:a10".
Could you suggest me something about this problem? I

would like some
windows like the ones you use when you select data for a

graphic.
Thank you.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Asking for a group of cells

Max,

You need Application.Inputbox. If you use this with a type of 8 you can
select a range of cells, and the address of these cells is returned to
Inputbox.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Max_Venezia" wrote in message
om...
I'm looking for an instruction to be used into a macro which gives the
possibility to interrupt the macro until you select a group of cells
with the mouse. Then the macro has to perform some operations on the
selected cells.
I tried with InputBox but it does not permit to select a range of
cells with the mouse, you can only write it with the keyboard, for
example: "a1:a10".
Could you suggest me something about this problem? I would like some
windows like the ones you use when you select data for a graphic.
Thank you.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Asking for a group of cells

Max,

Try something like the following code:

Dim SelectedRange As Range
On Error Resume Next
Set SelectedRange = Application.InputBox( _
prompt:="Select A Range", Type:=8)
If SelectedRange Is Nothing Then
MsgBox "You clicked cancel"
Else
MsgBox "You selected: " & SelectedRange.Address
End If
On Error GoTo 0


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Max_Venezia" wrote in message
om...
I'm looking for an instruction to be used into a macro which

gives the
possibility to interrupt the macro until you select a group of

cells
with the mouse. Then the macro has to perform some operations

on the
selected cells.
I tried with InputBox but it does not permit to select a range

of
cells with the mouse, you can only write it with the keyboard,

for
example: "a1:a10".
Could you suggest me something about this problem? I would like

some
windows like the ones you use when you select data for a

graphic.
Thank you.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Asking for a group of cells

Hi Max,
I would have the InputBox use a default of the
activecell or the current selection.

See webpage:
InputBox and MsgBox
http://www.mvps.org/dmcritchie/excel/inputbox.htm

and the specific example:
Multiple Range Selection in InputBox (#multi)
http://www.mvps.org/dmcritchie/excel/inputbox.htm#multi
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm





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
Match a group of cells with another group of cells Rod in Oz Excel Worksheet Functions 1 October 9th 08 01:45 AM
Copy Data from One Group of Cells to Another Group Alan Auerbach Charts and Charting in Excel 2 May 27th 07 04:12 PM
from a group of cells.find average of cells containing values farm Excel Discussion (Misc queries) 1 December 21st 06 08:50 PM
How do I name a group of cells? barronka Excel Discussion (Misc queries) 2 March 9th 06 03:50 PM
copy group of cells to another group of cells using "IF" in third Chuckak Excel Worksheet Functions 2 November 10th 04 06:04 PM


All times are GMT +1. The time now is 06:50 PM.

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"