Adding a new row in VB

  • Thread starter Thread starter soph
  • Start date Start date
S

soph

Hi

I have a rolling data sheet which I need to update with the previous day's
data each morning. eg if today is the 03/05 then I add a new row today for
the 02/05. I would like to create a macro to copy the last row of data and
copy it down which should update the date. can anyone help me with how to do
this?

Greatly appreciated
Soph
 
Dim LastRow As Long

LastRow = Cells(Rows.Count, "A").End(xlUp).Row

Rows(LastRow).Copy Cells(LastRow + 1, "A")
Cells(LastRow + 1, "A").Value = Cells(LastRow, "A") - 1


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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