Macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello there,

How do I create a macro to clear values in certain cells only, in one
worksheet?

Many Thanks
 
Hi Terry,

By way of example, to clearvalues in the ranges A1:D10 and A20:B25, try:

Sub TestA()
Dim Rng As Range

Set Rng = Union(Range("A1:D10"), Range("A20:B25"))
Rng.ClearContents

End Sub
 
try
sheets("sheet1").range("a1,b4,c5").clearcontents
Hope you get a good grade
 

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