VBA Code Help

stacey52891

New Member
Joined
Sep 9, 2013
Messages
12
I need help writing VBA Code that will work for a spreadsheet I am working on. I have tried the record macro process but I cannot get a date column I am working with the format correctly. This data is coming from a program and needs to be scrubbed so formulas can be written for it.

In column A: I have statuses. I need any lines of data that have a status of "DENI" or "PEND".

In column B: I need these cells to be formatted to: MM/DD/YYYY

I need this to be done on multiple sheets, could you show me how this could be nested together so that these actions are done on "Sheet1", "Sheet2", and "Sheet3". However, this does not need to be done to ALL sheets. Thank you so much for your help with this.

App Statuslast_update_time
COMPL2017-Jan-04 10:03:14
COMPL2017-Jan-05 16:49:47
COMPLETED2017-Jan-04 16:59:50
COMPLETED2017-Jan-05 12:28:00
DENI2017-Jan-05 00:15:16
DENI2017-Jan-05 00:15:16
N/A2017-Jan-04 10:47:45
N/A2017-Jan-05 16:08:31
PEND2017-Jan-05 16:49:47
PEND2017-Jan-04 10:03:14
START2017-Jan-05 16:08:31
START2017-Jan-04 10:47:45
STARTED2017-Jan-05 12:28:00
STARTED2017-Jan-04 16:59:50

<tbody>
</tbody><colgroup><col><col></colgroup>



<tbody>
</tbody><colgroup><col><col></colgroup>
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
App Statuslast_update_timenewdateformat
COMPL2017-Jan-04 10:03:1401/04/2017
COMPL2017-Jan-05 16:49:4701/05/2017Count of newdateformatApp Status
COMPLETED2017-Jan-04 16:59:5001/04/2017newdateformatDENIPENDGrand Total
COMPLETED2017-Jan-05 12:28:0001/05/201701/04/2017 11
DENI2017-Jan-05 00:15:1601/05/201701/05/2017213
DENI2017-Jan-05 00:15:1601/05/2017Grand Total224
N/A2017-Jan-04 10:47:4501/04/2017
N/A2017-Jan-05 16:08:3101/05/2017
PEND2017-Jan-05 16:49:4701/05/2017
PEND2017-Jan-04 10:03:1401/04/2017
START2017-Jan-05 16:08:3101/05/2017
START2017-Jan-04 10:47:4501/04/2017
STARTED2017-Jan-05 12:28:0001/05/2017
STARTED2017-Jan-04 16:59:5001/04/2017
Apr04
Aug08
Dec12
Feb02
Jan01
note the new column of dates to your formatJuly07
are NOT dates - they are textJun06
Mar03
May05
the pivot table has found the 1/4/17 PENDNov11
and the duplicate entries on rows 6 and 7Oct10
and the pending on 1/5/17Sep09

<colgroup><col><col><col><col span="2"><col><col span="2"><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,110
Messages
6,123,140
Members
449,098
Latest member
Doanvanhieu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top