Looping Macro That Changes The Value Of A Cell Based On Another Cell

antifragile

New Member
Joined
Dec 22, 2014
Messages
13
Hi experts,

I have a spreadsheet that needs a rather complex macro solution, for someone like myself at least. I will try to explain as simple as I can and provide as much clarity as possible (please see the file in this provided link as you go over the below inquiry)

Goal: Elimination Of "Expedite" Values By Updating Certain Rows' Dates To An Earlier Date So The Outcome Of Targeted Cells That Need "Expediting" In Column G Will Be "Ok" Or "Good"

Ideally The Desired Macro Should Do The Following In An Orderly Fashion:

- Sort Column "B" Ascending
- Sortcolumn "A" Ascending
- Calculation Manual (Stop Auto Calculation)

If The Row Has "Expedite" Value On Column "G". (Step 1)
Then Find The Next Column Of Same Item (Column A) Thathas"Po" Value In Column "D" And
Cut The Date And Paste It To Column "H" Of Same Row And Insert A Date On Column " D" That Is The Last Weekday Before The Date Of Row Thatwas Found In "Step 1".

- Sort Column "B" Ascending
- Sortcolumn "A" Ascending
- Calculate Now

'This Process Should Result In Conversion Of "Expedite" Value To Either "Ok" Or "Good" In Column "G" At Targeted Row In "Step 1" ==> This Is Our Ultimate Goal.
Because Every Date Change Will Affect The Outcome Of Formula On Column "G", The Calculation Has To Be Re-Triggered After Each Loop. Thats Why I Added Calculation Manual/Now Requirements.

Loop(Repeat Process To Find The Next Expedite)

When No More Rows Are Found With "Expedite" Value In Column "G"
Then Count Cells That Have Dates On Column H (Total Of X)
Message Box:"No Expedite Row Was Found. Xnumber Of Rows' Dates Have Been Updated"

I truly appreciate your suggestions for a macro solution.
(Please note that I have submitted the same inquiry to another VBA forum as well.)
https://www.ozgrid.com/forum/forum/...pdates-cell-value-based-on-another-cell-value
 
Last edited by a moderator:

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
- Sort Column "B" Ascending
- Sortcolumn "A" Ascending

I apologize for this incorrect information. Sorting order should be as below:
- Sort Column "A" Ascending
- Sor Column "B" Ascending
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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