How to Replace blank cell with specific value

manoj_arsul

Board Regular
Joined
Jun 27, 2018
Messages
61
I want program for below condition

1. filter to column "D" for blank .
2. Replace all blank cell in column "D" with Not OK.
3. Clear Filter .
4. filter to column "D" for Not OK.
5. filter to column "A" for Pending.
6. Replace all these pending As Pending - Not OK

Example is
Row Data
<style type="text/css"> body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Calibri"; font-size:x-small } </style>
Status*CityCountryTest
PendingPuneIndiaOk
PendingMumbaiIndiaOk
PendingLondonEngland
PendingPuneIndia
PendingMumbaiIndiaOk
PendingMumbaiIndia
PendingLondonEngland
PendingPuneIndia
Waiting LondonEnglandOk
Waiting PuneIndiaOk
Waiting MumbaiIndia
Waiting LondonEngland
Waiting PuneIndiaOk
WorkingMumbaiIndiaOk
WorkingLondonEngland
WorkingPuneIndiaOk
WorkingMumbaiIndiaOk
ClosedLondonEngland
ClosedLondonEngland
ClosedPuneIndia
ClosedMumbaiIndia
ClosedLondonEnglandOk
ClosedPuneIndiaOk
ClosedMumbaiIndia
ClosedLondonEngland

<tbody>
</tbody>

Out Put :

<style type="text/css"> body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Calibri"; font-size:x-small } </style>
Status*CityCountryTest
PendingPuneIndiaOk
PendingMumbaiIndiaOk
Pending - Not OKLondonEnglandNot OK
Pending - Not OKPuneIndiaNot OK
PendingMumbaiIndiaOk
Pending - Not OKMumbaiIndiaNot OK
Pending - Not OKLondonEnglandNot OK
Pending - Not OKPuneIndiaNot OK
Waiting LondonEnglandOk
Waiting PuneIndiaOk
Waiting MumbaiIndiaNot OK
Waiting LondonEnglandNot OK
Waiting PuneIndiaOk
WorkingMumbaiIndiaOk
WorkingLondonEnglandNot OK
WorkingPuneIndiaOk
WorkingMumbaiIndiaOk
ClosedLondonEnglandNot OK
ClosedLondonEnglandNot OK
ClosedPuneIndiaNot OK
ClosedMumbaiIndiaNot OK
ClosedLondonEnglandOk
ClosedPuneIndiaOk
ClosedMumbaiIndiaNot OK
ClosedLondonEnglandNot OK

<tbody>
</tbody>



 
Last edited by a moderator:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
How about
Code:
Sub NotOk()
   With Range("A2", Range("A" & Rows.Count).End(xlUp))
      .Offset(, 3).SpecialCells(xlBlanks).Value = "Not OK"
      .Value = Evaluate(Replace(Replace("if((@=""Pending"")*(@d=""Not OK""),""Pending-Not OK"",@)", "@d", .Offset(, 3).Address), "@", .Address))
   End With
End Sub
 
Upvote 0
How about
Code:
Sub NotOk()
   With Range("A2", Range("A" & Rows.Count).End(xlUp))
      .Offset(, 3).SpecialCells(xlBlanks).Value = "Not OK"
      .Value = Evaluate(Replace(Replace("if((@=""Pending"")*(@d=""Not OK""),""Pending-Not OK"",@)", "@d", .Offset(, 3).Address), "@", .Address))
   End With
End Sub
Thank u @Fluff
 
Last edited by a moderator:
Upvote 0
I want one more program for the below condition.(Last 5 Days Count City wise .)


1) Filter to Column "A" Status For Working .
2) Filter to Column "B" City For Pune.
3) Get Till date (Today) Count of column "A" in the cell of table ( Today 19th)
4) Filter Today()-1 & Get date Count of column "A" in the cell of table ( 18th July)
5) Filter Today()-2 & Get date Count of column "A" in the cell of table ( 17th July)
6) Filter Today()-3 & Get date Count of column "A" in the cell of table ( 16th July)
7) Filter Today()-4 & Get date Count of column "A" in the cell of table ( 15th July)

Do the Same condition with other Pending , Pending - Not OK , Waiting

Source Data: -
<style type="text/css"> body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Calibri"; font-size:x-small } </style>
Status*CityCountryTestDate
Pending Pune India Ok19-Jul-18
Pending Mumbai India Ok17-Jun-18
Pending - Not OK London England Not OK16-May-18
Pending - Not OK Pune India Not OK15-Jul-18
Pending Mumbai India Ok18-Jul-18
Pending - Not OK Mumbai India Not OK19-Jul-18
Pending - Not OK London England Not OK17-Jul-18
Pending - Not OK Pune India Not OK16-Jul-18
Waiting London England Ok15-Feb-18
Waiting Pune India Ok18-Jul-18
Waiting Mumbai India Not OK19-Jul-18
Waiting London England Not OK17-Jul-18
Waiting Pune India Ok16-Jun-18
Working Mumbai India Ok5-Mar-18
Working London England Not OK18-Jul-18
Working Pune India Ok19-Jul-18
Working Pune India Ok17-Mar-18
Closed London England Not OK16-Jul-18
Closed London England Not OK15-Jul-18
Closed Pune India Not OK18-Jul-18
Closed Mumbai India Not OK19-Jul-18
Closed London England Ok17-Jul-18
Closed Pune India Ok16-Jul-18
Closed Mumbai India Not OK15-Jul-18
Closed London England Not OK18-Jul-18

<tbody>
</tbody>


Out Put :

<style type="text/css"> body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Calibri"; font-size:x-small } </style>
PuneWorking Count Pending CountPending - Not OKWaiting Count
15-Jul-180010
16-Jul-180021
17-Jul-181021
18-Jul-181022
19-Jul-182122

<tbody>
</tbody>



 
Last edited by a moderator:
Upvote 0
As this is a completely different question, please start a new thread.
But before you do, I do not know where you are copy/pasting your posts from, but please do not do it. It normally occurs when you are pasting a table. if you follow the link in my signature you will tools to help with that.
I have had to clean a lot of them up as they are so small as to be virtually unreadable.
You can use the test board to check that things are working properly before starting a new thread
 
Last edited:
Upvote 0
ok Fluff I am going to raise new Thread for the same .

And this is not copy paste Question . Only I am going to same source data ( only for reference ).

Thank you Again !!!
 
Upvote 0

Forum statistics

Threads
1,213,533
Messages
6,114,179
Members
448,554
Latest member
Gleisner2

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