Macro's to select an increasing range of data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
If the Rows increase first you need to find your last row therefore:

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

Range("A1:C" & iLastRow).select
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top