Simple delete macro

  • Thread starter Thread starter LiAD
  • Start date Start date
L

LiAD

Good afternoon,

Could somebody show me a simple macro please for how to delete entries in
cells.
I have text in cells B4-AA20 that I wanted to be able to delete by a macro.

Thanks
LD
 
Hi,

At it's simplest this will do it

Range("B4:AA20").ClearContents

Be aware that this deletes everything in that range, if that's not what you
want then post back.

Mike
 
If you select range B4:AA20 and press Delete while recording a macro then
you get this sub:

Sub Macro1()
Range("B4:AA20").Select
Selection.ClearContents
End Sub

You can then edit it this way if you prefer compact code:
Sub Macro1()
Range("B4:AA20").ClearContents
End Sub


Regards,
Stefi

„LiAD†ezt írta:
 
Lovely,

I'd forgotten the simple way to record macros rather than writing code.

Thanks for the reminder.
 
You are welcome! Thanks for the feedback!
Stefi

„LiAD†ezt írta:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top