Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
When entering data into a range of cells, select the entire range. | Excel Discussion (Misc queries) | |||
Increasing the Source Data range for an existing Pivot Table | Excel Worksheet Functions | |||
Increasing a range of grades available | Excel Worksheet Functions | |||
How do I edit a Named Range using macro's | Excel Worksheet Functions | |||
Increasing a range in a loop | Excel Programming |