PC Review


Reply
Thread Tools Rate Thread

Cells in a range

 
 
=?Utf-8?B?RGF2aWQ=?=
Guest
Posts: n/a
 
      1st Nov 2006
Hi Group,

I have selected a range of cells, but they are not contiguous, ie. A5, A7,
A9 through A15, A100, which I have done manually. I would like the code to go
through each cell selected, where I am drawing off information in cells to
the right of the selected cell. I have the code to get the information and
can do this easily on a single cell, but I would like to select as I have
outlined above and have the macro do the rest.

Thanks,
--
David
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      1st Nov 2006
For Each cell In Range("A5,A7,A9:A15,A100")
MsgBox cell.Offset(0, 1).Address
Next cell


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"David" <(E-Mail Removed)> wrote in message
news:1ACE2607-171C-4EB6-AE9A-(E-Mail Removed)...
> Hi Group,
>
> I have selected a range of cells, but they are not contiguous, ie. A5, A7,
> A9 through A15, A100, which I have done manually. I would like the code to

go
> through each cell selected, where I am drawing off information in cells to
> the right of the selected cell. I have the code to get the information and
> can do this easily on a single cell, but I would like to select as I have
> outlined above and have the macro do the rest.
>
> Thanks,
> --
> David



 
Reply With Quote
 
=?Utf-8?B?RGF2aWQ=?=
Guest
Posts: n/a
 
      1st Nov 2006
The problem is setting the range selected. I found a way to step through a
named range, but i have to name the range manually. I was hoping I could set
a named range for the selected cells in the code. I set TestRange before I
start the code and it will "step" the named range, but the next time I want
to do this, the range will be different, it is dynamic. I would like to
rename the range with the new selection each time.

Thanks,
--
David


"Bob Phillips" wrote:

> For Each cell In Range("A5,A7,A9:A15,A100")
> MsgBox cell.Offset(0, 1).Address
> Next cell
>
>
> --
>
> HTH
>
> Bob Phillips
>
> (replace xxxx in the email address with gmail if mailing direct)
>
> "David" <(E-Mail Removed)> wrote in message
> news:1ACE2607-171C-4EB6-AE9A-(E-Mail Removed)...
> > Hi Group,
> >
> > I have selected a range of cells, but they are not contiguous, ie. A5, A7,
> > A9 through A15, A100, which I have done manually. I would like the code to

> go
> > through each cell selected, where I am drawing off information in cells to
> > the right of the selected cell. I have the code to get the information and
> > can do this easily on a single cell, but I would like to select as I have
> > outlined above and have the macro do the rest.
> >
> > Thanks,
> > --
> > David

>
>
>

 
Reply With Quote
 
=?Utf-8?B?RGF2aWQ=?=
Guest
Posts: n/a
 
      2nd Nov 2006
There is not a way to do this that I know of. Easy to delete a named range,
but not a way to know what is currently selected in a range, especially if
the range is not contiguous and then name it. Any ideas would be welcome.
Selecting and naming the range prior to starting the macro works well, but I
would like it to happen in the macro.

Thanks,
--
David


"Bob Phillips" wrote:

> For Each cell In Range("A5,A7,A9:A15,A100")
> MsgBox cell.Offset(0, 1).Address
> Next cell
>
>
> --
>
> HTH
>
> Bob Phillips
>
> (replace xxxx in the email address with gmail if mailing direct)
>
> "David" <(E-Mail Removed)> wrote in message
> news:1ACE2607-171C-4EB6-AE9A-(E-Mail Removed)...
> > Hi Group,
> >
> > I have selected a range of cells, but they are not contiguous, ie. A5, A7,
> > A9 through A15, A100, which I have done manually. I would like the code to

> go
> > through each cell selected, where I am drawing off information in cells to
> > the right of the selected cell. I have the code to get the information and
> > can do this easily on a single cell, but I would like to select as I have
> > outlined above and have the macro do the rest.
> >
> > Thanks,
> > --
> > David

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
change colors in a range of excel cells based on another range of cells Bobbi Muck Microsoft Excel Programming 1 9th Apr 2010 03:47 AM
how to compute a range of cells based on another range of cells? =?Utf-8?B?SEFST0xE?= Microsoft Excel Worksheet Functions 1 30th Dec 2005 09:32 PM
how to compute a range of cells based on another range of cells? =?Utf-8?B?SEFST0xE?= Microsoft Excel Worksheet Functions 2 30th Dec 2005 07:55 PM
Copy a formula to a range of cells via VB6 using .Range(Cells(row,col), Cells(row,col)).Formula= statement Kevin Microsoft Excel Programming 7 5th Oct 2004 08:11 PM
Is there a range function (i.e. Max(range of cells)-Min(range of cells))?? ModelerGirl Microsoft Excel Misc 3 26th Jul 2004 10:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:03 AM.