Delete Data

Status
Not open for further replies.

Reji Rajan

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
I get a weekly report which has datewise & timewise data, is there a way where I could select the first date on the extracted report & delete some data as per the timeband that I need, likewise select the end date & then delete some more data. I have managed to delete the data as per my required timebands but my recorded macro doesnt work for date selection. The date is in column C, the thing is every Monday I work in the last week's report, have to edit a lot of stuff, hence the need to automate. My date range is Sunday to Sunday. From the first date, I need data from certain timeband only, hence want to select the first date & delete certain data. hope there is solution to this issue
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You're working with an Excel macro? You can pick up the date by referencing a cell - or if the time period is always the same, you can calculate the date and grab them.

This should get last week (Monday to Sunday) if my calculations are correct- replace the start and end dates in your macro with x2 and y2. if you need Sunday to Saturday, change the 3 in Date,3 to 2
Code:
Dim x As Date
Dim y As Date
Dim x2 As String
Dim y2 As String

x = Date - Application.WorksheetFunction.Weekday(Date, 3) - 7
y = x + 6

x2 = Month(x) & "/" & Day(x) & "/" & Year(x)
y2 = Month(y) & "/" & Day(y) & "/" & Year(y)
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
T How To Delete AN Email Acoount Without Losing The Data File? Using Outlook 1
W Cannot delete Outlook 2010 data file Using Outlook 1
C crash during account setup - can't delete corrupted account/data file Using Outlook 13
T Outlook 2010 How to Delete “Orphaned” TO DO? ( Not on Exchange Server) Using Outlook 6
P How did hacker cause link to delete and archive containing email? Using Outlook 6
Z Outlook 365 delete reminder you can’t make change to contents of this-read only folder Using Outlook 4
J To delete the draft email Using Outlook 2
W Recurrence: delete older occurrences / change earliest start time Outlook VBA and Custom Forms 0
J Moved many emails to Outlook external folder, need to delete on Gmail server Using Outlook 14
A Attachments.Delete Outlook VBA and Custom Forms 3
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
R Expand VBA Permanent Delete Code Outlook VBA and Custom Forms 6
M Delete headers in Inline reply Outlook VBA and Custom Forms 5
N VBA to delete duplicates by message-id on common pst for 2 or more emails Outlook VBA and Custom Forms 0
S How can I delete all copies of a given companies logo graphic from all my emails at once? Using Outlook 3
9 Outlook 2016 How to save an Outlook attachment to a specific folder then delete the email it came from? Using Outlook 1
D after delete mail, open the next one Outlook VBA and Custom Forms 0
O Delete duplicate emails - subscription notifications Using Outlook 5
F Delete/create/reset Exchange mailbox on Outlook.com Using Outlook.com accounts in Outlook 3
L Email Read and Delete Outlook VBA and Custom Forms 4
H Delete Calendar Entries in Using Outlook 2
D Delete Emails from Senders in Shared Mailbox Outlook VBA and Custom Forms 1
R How to delete Facebook Contacts folder in Outlook 365 Using Outlook 7
R VBA Code to permanently delete selected email Outlook VBA and Custom Forms 10
JoeG Appointment Delete/Change Recurrence Outlook VBA and Custom Forms 0
C Outlook 2016 cannot delete, email showing in root Exchange Server Administration 5
C How to replace or delete first instance of sentence in mail body? Outlook VBA and Custom Forms 1
Z Can't delete IMAP folder Using Outlook 2
J Delete old emails Exchange Server Administration 1
undercover_smother Automatically Forward All Sent Mail and Delete After Send Outlook VBA and Custom Forms 10
T Delete Emails from search results Outlook VBA and Custom Forms 1
I Outlook 2013 How do I delete a Calendar? Using Outlook.com accounts in Outlook 1
N How to delete default folder "Contacts" (olFolderContacts) in a .pst file Using Outlook 8
O How to delete posts New Slipstick.com Articles 1
B How to 'really' delete IMAP emails? Using Outlook 6
H Search and delete part of a link inside HTML body message Outlook VBA and Custom Forms 2
B Delete/replace old files and save new attachments Using Outlook 1
D Delete selected text from incoming emails Outlook VBA and Custom Forms 25
mikolajek Random message selected after hard delete Using Outlook 4
Jeanne Goodman Delete Calendar Item Bypassing Deleted Items folder Outlook VBA and Custom Forms 2
C Delete Subject-Add Organizer to all Reservations in Default Calendar. Using Outlook 0
P Delete mail macro Outlook VBA and Custom Forms 6
B Outlook 2016: Can't delete default calendar but I don't use it Using Outlook 7
O How to delete duplicate RSS messages? Using Outlook 6
J "This item has been changed still want to delete it" message Using Outlook 3
M Can't Delete iCloud Calendar Notifications From Outlook 2016 Using Outlook 0
P Delete Icon Using Outlook 2
makinmyway Bulk Delete Contacts in iOS Outlook App Using Outlook 4
Diane Poremsky Delete an Outlook Group New Slipstick.com Articles 0
M Cannot Delete Emails from IMAP inbox Using Outlook 4

Similar threads

Top