Rest Value in One Cell, Based on Another Cell's Input

JoshPocock

New Member
Joined
Apr 18, 2011
Messages
3
I am placing Customers into Column A, and then they get a "ranking" in Column D.

Once these customers reach a certain criteria, they will get deleted from this sheet, and replaced with a new one (at a later time) manually. However, if their "ranking" in Column D is not rest to "1" when they are deleted, it causes problems elsewhere.

I have the following formula, but it just is not working. If I replace the "" with an actual value and test it, it works fine. I just cannot seem to get it to work if Column A is empty.


'Reset Potential to 1 for Unused Cells
Sheets("Prospect_Inputs").Select
Dim lngLastRow As Long
Dim i As Long
lngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lngLastRow
If ActiveSheet.Cells(i, "A").Value = "" Then ActiveSheet.Cells(i, "D").Value = "1"
Next i
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,224,617
Messages
6,179,915
Members
452,949
Latest member
beartooth91

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