Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Adding a new row in VB

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Adding a new row in VB

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)



"soph" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Just adding Learning Excel Excel Discussion (Misc queries) 4 October 27th 07 06:45 PM
adding some rows in the middle of adding some other rows Janis Excel Programming 3 October 4th 07 03:20 AM
Adding every 5th row (e.g. B5 + B10 + B15 etc) Shazzer Excel Discussion (Misc queries) 6 December 20th 06 08:00 PM
Adding 1 Zaahir Excel Programming 2 October 18th 06 02:09 PM
Adding with & Jim Excel Worksheet Functions 3 February 4th 05 03:30 AM


All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"