View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Tim Marsh Tim Marsh is offline
external usenet poster
 
Posts: 49
Default delete contents of visible cells only

Hi Norman,

I agree with everything you've said. However, I've discovered on several
occasions I have found peoples problems to be misinterpreted (because they
fail to explain a vital bit of information) or tackled with VB because (as
you say) its been posted in a programming newsgroup (which is the natural
place to post the message when you *think* the solution must use VB).

I know this to be the case because i am one of those people that has asked
for a VBA solution to something that could have been achevied from just a
few menu options; I'm not an Excel novice, but there are still some areas
that i don't use very often, so i never think to use them and I would
always choose a built in solution over having to create VBA to do the same
job (in the right circumstances).

There is nothing wrong with the code you provided, I'm merely suggesting an
alternative that Michael may not have known existed.

Having said all that, when i inevitably post a message looking for help, I
would very thankful for any VBA code snippets you could provide! I think
this is the most amazingly useful newsgroup i have ever seen.

Regards,

Tim


"Norman Jones" wrote in message
...
Hi Tim,

if its a one-off, would it not be easier to use
Edit Goto Special Visible cells only


If this were a one-off operation, I doubt that Michael would be seeking a
programmatic solution and it is even less likely that he would be
concerned with the speed and efficiency advantages of one coded approach
over another. Perhaps, most telling of all, however, was the decision to
post the question in the programming group.

As this is a programming group, how does:

Edit Goto Special Visible cells only


differ from the initially advocated:

Range("A1:D10").SpecialCells(xlCellTypeVisible).Cl earContents ?

Except, perhaps, that the latter additionally defines the range and
deletes the contents.


---
Regards,
Norman