Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Macro's to select an increasing range of data

Hi there,

I'm writing a macro at the moment to select for example cells A:1 to C:5,
this i can do, however this range of data increases. Today it might be A:1 to
C:5 and tomorrow it might be A1 to C6. I'm having minimal success with this.
Can someone please tell me how i can achieve it?
Many thanks in advance

Simon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Macro's to select an increasing range of data

If the Rows increase first you need to find your last row therefo

iLastRow = Range("C65536").end(xlup).row
Then you will need something like this

Range("A1:C" & iLastRow).select


--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Simon - M&M" wrote:

Hi there,

I'm writing a macro at the moment to select for example cells A:1 to C:5,
this i can do, however this range of data increases. Today it might be A:1 to
C:5 and tomorrow it might be A1 to C6. I'm having minimal success with this.
Can someone please tell me how i can achieve it?
Many thanks in advance

Simon

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Macro's to select an increasing range of data

Assuming it's column C that grows, try this:-

Sub liminal()
LastrowColC = Range("C65536").End(xlUp).Row
Range("A1:C" & LastrowColC).Select
End Sub

Mike

"Simon - M&M" wrote:

Hi there,

I'm writing a macro at the moment to select for example cells A:1 to C:5,
this i can do, however this range of data increases. Today it might be A:1 to
C:5 and tomorrow it might be A1 to C6. I'm having minimal success with this.
Can someone please tell me how i can achieve it?
Many thanks in advance

Simon

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Macro's to select an increasing range of data

maybe:

Range("A1").CurrentRegion.Select


--
Hope that helps.

Vergel Adriano


"Simon - M&M" wrote:

Hi there,

I'm writing a macro at the moment to select for example cells A:1 to C:5,
this i can do, however this range of data increases. Today it might be A:1 to
C:5 and tomorrow it might be A1 to C6. I'm having minimal success with this.
Can someone please tell me how i can achieve it?
Many thanks in advance

Simon

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Macro's to select an increasing range of data

Looking back at my origianl post my example is pretty poor.
I have formulas in Q5 TO AB20 with a sum formula running from Q21 TO AB21,
someone inserts a new row at the end of the selection of data so the data
range is Q5 TO AB21, however the sum formula doesn't include the new row. I
wanted a macro to select the data from Q5 TO AB21 and auto fill with the
formulas. Next day someone adds another row and the data range is now Q5 TO
AB22.
Any ideas?

Cheers

Simon


"Mike H" wrote:

Assuming it's column C that grows, try this:-

Sub liminal()
LastrowColC = Range("C65536").End(xlUp).Row
Range("A1:C" & LastrowColC).Select
End Sub

Mike

"Simon - M&M" wrote:

Hi there,

I'm writing a macro at the moment to select for example cells A:1 to C:5,
this i can do, however this range of data increases. Today it might be A:1 to
C:5 and tomorrow it might be A1 to C6. I'm having minimal success with this.
Can someone please tell me how i can achieve it?
Many thanks in advance

Simon



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Macro's to select an increasing range of data

That's worked a treat.

Thanks Very Much

"Vergel Adriano" wrote:

maybe:

Range("A1").CurrentRegion.Select


--
Hope that helps.

Vergel Adriano


"Simon - M&M" wrote:

Hi there,

I'm writing a macro at the moment to select for example cells A:1 to C:5,
this i can do, however this range of data increases. Today it might be A:1 to
C:5 and tomorrow it might be A1 to C6. I'm having minimal success with this.
Can someone please tell me how i can achieve it?
Many thanks in advance

Simon

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
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Increasing the Source Data range for an existing Pivot Table Shams Excel Worksheet Functions 2 October 10th 06 05:22 PM
Increasing a range of grades available confused teacher Excel Worksheet Functions 4 August 21st 06 06:25 AM
How do I edit a Named Range using macro's behmer Excel Worksheet Functions 2 July 26th 05 09:02 PM
Increasing a range in a loop ric Excel Programming 4 April 26th 04 07:59 PM


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