Re: ClearContents does not work...



The original code worked fine for me and there is no reason is shouldn't
work. It is the correct syntax and the correct command. Test it by opening
only a single new workbook. then put some values in Sheet1!F1:F15. Now do
Alt+F11 and insert a new module.

Put in code like

Sub AAA()
Worksheets("Sheet1").Range("F1:F15").ClearContents
end Sub

Run the macro. It should work as you would expect.

--
Regards,
Tom Ogilvy

"Kjartan" <someone@xxxxxxxxxx> wrote in message
news:uJhOuJYfFHA.2152@xxxxxxxxxxxxxxxxxxxxxxx
> Miguel,
> Thank you for your reply.
> My code is in a module. Adding the Workbookname did not work either...
>
> "Liedson31" <Liedson31@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:8EBE8AE5-1B17-4525-854E-3F0A968019A7@xxxxxxxxxxxxxxxx
> > hi kjartan....
> > yes the code you have is ok....it works...
> > 1 questions:
> > are you running this one in the workbook you want to "clearcontents"
> >
> > if you don´t you have to put:
> >
workbooks("workbookname").Worksheets("Sheet1").Range("F1:F15").ClearContents
> >
> > cheers
> > Miguel
> >
> > "Kjartan" wrote:
> >
> >> To make 'Empty' cells I expected this to work:
> >>
> >> Worksheets("Sheet1").Range("F1:F15").ClearContents
> >>
> >> .... but it does nothing... does not even clear numbers in those cells.
> >> Do I need to use another method for this purpose ?
> >>
> >>
> >> Thank's,
> >> Kjartan
> >>
> >>
> >>
>
>


.