How do Clear data from cells after running a macro

ghrek

Active Member
Joined
Jul 29, 2005
Messages
426
Hi

I have the following macro and it does add lines below the last line of the worksheet when I run it but it also copies and pastes the data and I just need the formulas to be pasted so the new lines are blank

Any Ideas?

VBA Code:
Sub Insert_300_Rows()
    Dim LR      As Long
    LR = Range("AB" & Rows.Count).End(xlUp).Row    'detect last used row in column AB
    Rows(LR & ":" & LR + 300).FillDown            'paste down formats & formulas (if any)
   
End Sub
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
If you only want formulas, I think you have to Select, copy and PasteSpecial?
see
or something like post 3 here
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,237
Members
448,555
Latest member
RobertJones1986

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