Adding data and date

W

Wayne Burritt

Hi: I have 2 columns of data like so...

A B
1 Date Result
2 1/15/04 $234
3 1/16/04 $241
4 1/17/04 $251

and so on...

Each day, I have to go in and add today's date and today's result, which is
a static cell reference R213. I'd like to program a macro that finds the
next available row -- in this case row 5 -- adds today's day and today's
result from R213. Any ideas? Thanks. Wayne
 
A

Andy Brown

Each day, I have to go in and add today's date and today's result, which
is
a static cell reference R213. I'd like to program a macro that finds the
next available row -- in this case row 5 -- adds today's day and today's
result from R213. Any ideas? Thanks. Wayne

Range("A1").End(xlDown).Offset(1, 0).Value = Date
Range("B1").End(xlDown).Offset(1, 0).Value = Range("R213").Value

Rgds,
Andy
 
W

Wayne Burritt

Thanks Andy: One more thing -- if I wanted to chart the results, how can I
make the chart find the new data?
 
W

Wayne Burritt

Hi Andy: I get a run-time error 1004: Application defined or
object-definded error.

Best, Wayne
 
D

Daniel.M

Hi Wayne,

Perhaps by describing the sheet object your working on (so you won't get into
trouble if you have currently selected a chart).

Assuming your sheet name is Sheet1

With Sheets("Sheet1")
.Range("A1").End(xlDown)(2) = Date
.Range("B1").End(xlDown)(2)= .Range("R213").Value
End With

Regards,

Daniel M.
 

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