Clear Contents of 2 ranges based on criteria

christechgeek

New Member
Joined
Sep 1, 2012
Messages
7
I have a macro that pastes information copied from a main sheet ('Current Month') and pastes it into another sheet. What I'd like to do is to add code to go back to my 'Current Month' sheet and clear the contents of the cells that I copied. My only problem is that I can't just clear all cells in the selected range, because there are some formulas in 3 columns.
So what I want to do after the macro is ran to paste the data, is go back to my 'Current Month' sheet and clear the copied cells except for columns F,L AND O.
If possible, it would best to clear range B:E, M:N & R:S based on the word "Funded" being in column P. My criteria "Funded" is based on a droplist and the only rows that I will be concerned with would be from rows 470:520.
Here is my Paste data macro that I would like to add this code to:
PHP:
Sub PasteValuesOnly()
'
' PasteValuesOnly Macro
'
    On Error GoTo Err
    ActiveSheet.Select
    Range("A" & Rows.Count).End(xlUp).Offset(1).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
Err:
    x = MsgBox("Nothing copied")
    
End Sub

I appreciate any help you can give me! Thanks!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,216,096
Messages
6,128,807
Members
449,468
Latest member
AGreen17

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