VBA to lock rows after a certain date

piqalap

New Member
Joined
Sep 18, 2014
Messages
1
Hi!
Please help me woth the following problem (it starts with B2):

[TABLE="width: 1194"]
<tbody>[TR]
[TD]Contract no.[/TD]
[TD]Date[/TD]
[TD]Today[/TD]
[TD]Partner company[/TD]
[TD]Merchandise[/TD]
[TD]Shipping date[/TD]
[TD]Adjustments[/TD]
[TD]Etc.1[/TD]
[TD]Etc.2[/TD]
[TD]Etc.3[/TD]
[TD]Etc.4[/TD]
[TD]Etc.5[/TD]
[TD]Etc.6[/TD]
[TD]Etc.7[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]2014.02.12[/TD]
[TD="align: right"]2014.09.18[/TD]
[TD]XYZ Inc.[/TD]
[TD]Books[/TD]
[TD="align: right"]2014.02.26[/TD]
[TD]No[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]2014.03.13[/TD]
[TD="align: right"]2014.09.18[/TD]
[TD]ASD Co.[/TD]
[TD]Food[/TD]
[TD="align: right"]2014.03.27[/TD]
[TD]No[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD="align: right"]2014.07.12[/TD]
[TD="align: right"]2014.09.18[/TD]
[TD]FYI Inc.[/TD]
[TD]Cars[/TD]
[TD="align: right"]2014.07.26[/TD]
[TD]No[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD="align: right"]2014.08.19[/TD]
[TD="align: right"]2014.09.18[/TD]
[TD]LOL Co.[/TD]
[TD]Pens[/TD]
[TD="align: right"]2014.09.02[/TD]
[TD]Shipment changed[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD="align: right"]2014.10.01[/TD]
[TD="align: right"]2014.09.18[/TD]
[TD]TBA Inc.[/TD]
[TD]Jokes[/TD]
[TD="align: right"]2014.10.15[/TD]
[TD]No[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[/TR]
[TR]
[TD="align: right"]2000[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[TD]….[/TD]
[/TR]
</tbody>[/TABLE]

I'd like to lock the entire rows where the "Date" column is smaller than the "Today" column, in this example, only the Contract no. 5 could be modified. This should go up to 2000 rows.

Thank you!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,226,694
Messages
6,192,473
Members
453,726
Latest member
JoeH57

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