VBA code to Remove Formulas based on Date

rbara902

New Member
Joined
Mar 12, 2014
Messages
2
Hi,

I'm hoping I can get some helping with adding VBA code to my sheet that will remove the formulas if a certain date criteria is met.

Basically what I'm looking for is:
  • If B2>B4 then Copy and Paste Values from B5:B100
  • If B2>C4 then Copy and Paste Values from C5:C100
  • If B2>D4 then Copy and Paste Values from D5:D100
  • If B2>E4 then Copy and Paste Values from E5:E100
  • If B2>F4 then Copy and Paste Values from F5:F100
  • If B2>G4 then Copy and Paste Values from G5:G100
  • If B2>H4 then Copy and Paste Values from H5:H100
  • If B2>I4 then Copy and Paste Values from I5:I100
  • If B2>J4 then Copy and Paste Values from J5:J100
  • If B2>K4 then Copy and Paste Values from K5:K100
  • If B2>L4 then Copy and Paste Values from L5:L100
  • If B2>M4 then Copy and Paste Values from M5:M100

thank you in advance for your help!

Becky
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Code:
Sub conv2values()
For Each cell In Range("B4:M4")
If cell.Value < Range("b2").Value Then
cell.Offset(1, 0).Resize(96).Value = cell.Offset(1, 0).Resize(96).Value
End If
Next cell
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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