Macro to add data

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.
 
D

Dick Kusleika

Rick

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

Range("T65536").End(xlUp).Offset(1,0)
 
T

Tom Ogilvy

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
 

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

Top