Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Relative cell ranges

Hi

In the "Range("A5:E5").Select" statement I need to make the A5:E5 part
of it change as to whatever the active cell is at the time. I have no
idea as to what it will be before hand. Can anyone help me?

Erle

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Relative cell ranges

Activecell.Resize(,5).Select

--

HTH

RP
(remove nothere from the email address if mailing direct)


"edm" wrote in message
ups.com...
Hi

In the "Range("A5:E5").Select" statement I need to make the A5:E5 part
of it change as to whatever the active cell is at the time. I have no
idea as to what it will be before hand. Can anyone help me?

Erle



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Relative cell ranges

This might help, please tell me if it does or if it doesn't:

....
Dim r as Range
Dim s as String

s=ActiveCell.Value
For Each r in Range("A5:E5")
r.Value=s
Next r

....

That should set the active cell value to the range "A5:E5"

"edm" wrote:

Hi

In the "Range("A5:E5").Select" statement I need to make the A5:E5 part
of it change as to whatever the active cell is at the time. I have no
idea as to what it will be before hand. Can anyone help me?

Erle


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Relative cell ranges

Hi,

These do different things, depends on what you really wnt to do.

Sub Macro1()
ActiveCell.Range("A1:E1").Select
End Sub
(Selects from activecell right to include five cells)

Sub Macro2()
Selection.CurrentRegion.Select
End Sub
(Selects the active "Region")

Thanks,

"edm" wrote:

Hi

In the "Range("A5:E5").Select" statement I need to make the A5:E5 part
of it change as to whatever the active cell is at the time. I have no
idea as to what it will be before hand. Can anyone help me?

Erle


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Relative cell ranges

Thanks for your answer(s). I think I didn't make clear that the A5:E5
needs to change, it could be A23:E23 or A234:E234 or even L512:P512.

Thanks again
Erle



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Relative cell ranges

did u c my reply?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"edm" wrote in message
oups.com...
Thanks for your answer(s). I think I didn't make clear that the A5:E5
needs to change, it could be A23:E23 or A234:E234 or even L512:P512.

Thanks again
Erle



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
a twist to relative ranges Ray Pendergast Excel Discussion (Misc queries) 5 February 17th 07 02:08 AM
Relative Ranges in excel macro edself Excel Discussion (Misc queries) 6 October 13th 05 02:02 PM
Relative Ranges in excel macro edself Excel Worksheet Functions 6 October 13th 05 02:02 PM
using relative named ranges directly in functions Thunder Excel Programming 4 January 20th 05 09:31 PM
Specifying ranges relative to a cell Harlan Messinger[_2_] Excel Programming 8 May 21st 04 04:59 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"