|
-
Jan 18th, 2016, 03:00 AM
#1
Thread Starter
Junior Member
vba code for excel file
I'm creating a worksheet name 'current' in which the data is extracted from the server. When server adds new information, new row of these information needs to be appeared in the 'current' worksheet at the last row and shows 'new' in first column. User can update new information from the 'current' worksheet by column and 'new' needs to be shown in first column as well. The 'new' needs to be amended everyday. At the same time, I would like to create another worksheet which named as 'past'. In 'past' worksheet, all the data in 'past' worksheet will be automatically transferred to 'yesterday' worksheet about 7pm each day which is being updated everyday as well. Please help.
Thanks a lot.
-
Jan 18th, 2016, 05:05 AM
#2
Re: vba code for excel file
there is a recent thread that does several of these things see if it helps at all
http://www.vbforums.com/showthread.p...s-over-a-range
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jan 19th, 2016, 01:07 AM
#3
Thread Starter
Junior Member
Re: vba code for excel file
Hi westconn1, I've had a look at the thread you suggested and amended my code according to it. However, it doesn't seem to update the information for the time I set it to be. Would you mind helping me to check my code? Hope to hear from you soon.
Code:
Sub copypaste_RECENT()
Sheets("t").Range("B:V").Copy Destination:=Sheets("y").Range("B:V")
Application.OnTime Now + TimeSerial(12, 45, 0), "copypaste_RECENT"
End Sub
-
Jan 19th, 2016, 03:40 AM
#4
Re: vba code for excel file
is this procedure in a std module or an object module
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jan 19th, 2016, 04:12 AM
#5
Thread Starter
Junior Member
Re: vba code for excel file
Hi westconn1, the procedure is in standard module.
-
Jan 19th, 2016, 05:30 AM
#6
Re: vba code for excel file
is every 12¾ hours the correct schedule? or should it be something different?
if it is 12:45 pm, then it should not be adding the time to now
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jan 19th, 2016, 08:22 PM
#7
Thread Starter
Junior Member
Re: vba code for excel file
Hi westconn1, it's 12.45pm. Do you meant I should use Date instead of Now?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|