Macro to add data

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

Hi,
Could someone assist with this problem.
Thankyou


In T8 there is a heading.
T9:T110 is a data range.

I have various macros that compute groups of data which I
need to add cumulatively to the range.

The first click of a new macro must add data starting at
T9 down, say T9:T30.
The next one must add it's data to T31:?
And so on.

How do I make a macro that always starts adding data from
T9 and then with each subsequent click, adds the groups of
data from the bottom of the last data cell downwards.
 
Rick

To find the next available cell in column T, use code like this

Range("T65536").End(xlUp).Offset(1,0)
 
Sub Tester2()
Dim rng As Range
If IsEmpty(Range("T9")) Then
Set rng = Range("T9")
Else
Set rng = Range("T9:T110").SpecialCells(xlConstants)
Set rng = rng.Areas(rng.Areas.Count)
Set rng = rng(rng.Count)
Set rng = rng.Offset(1, 0)
End If
' no add data starting at rng
MsgBox "Start of new data is at " & rng.Address


End Sub
 
Back
Top