Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Various ways and inconsistencies of deleting cells in sheets

I have found inconsistencies in how one deletes all cells in a sheet.

..UsedRange.delete
cells.delete

but once you reset lastrow and lastcolumn, you still find "blank" active cells (not all the time but occasionaly enough that i can screw up you code).

The one which seems to be the most reliable is the following:

cells.EntireRow.Delete
cells.EntireColumn.Delete

I've googled around but have not found any good explanation.

What would a programmer use (I am not a programmer but I am trying to emulate my coding to one)?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Various ways and inconsistencies of deleting cells in sheets

On Thursday, July 26, 2012 9:58:46 PM UTC-4, wrote:
I have found inconsistencies in how one deletes all cells in a sheet.



.UsedRange.delete

cells.delete



but once you reset lastrow and lastcolumn, you still find "blank" active cells (not all the time but occasionaly enough that i can screw up you code).



The one which seems to be the most reliable is the following:



cells.EntireRow.Delete

cells.EntireColumn.Delete



I've googled around but have not found any good explanation.



What would a programmer use (I am not a programmer but I am trying to emulate my coding to one)?



Thanks


I got this from the Macro Recorder:
Cells.Select
Selection.Delete Shift:=xlUp

M
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Various ways and inconsistencies of deleting cells in sheets

Thanks. I was aiming at a cleaner code.

Cells.delete or activehseet.usedrange.delete seems to occasionally fail.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting ways of referencing cells Dave Peterson Excel Programming 1 April 15th 09 03:57 AM
converting ways of referencing cells keith Excel Programming 0 April 15th 09 03:21 AM
Ways to parse cells in mulitple selected locations Nature Excel Programming 0 July 18th 08 05:00 AM
Are there ways to protect multiple sheets at once? Monty New Users to Excel 3 May 29th 08 11:57 PM
Transposing cells & deleting sheets chasbot Excel Programming 0 April 5th 04 07:28 PM


All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"