Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Problem of selection.delete

Hi all,
we are currently using MSExcel 2003 version. We are facing a problem of
deleting perticular data by selecting the range. We are first selecting the
specified range and we are doing the selection.delete operation using macro.
But it is selecting the range but it is not deleting. If i gave
selection.clearformats and selection.clearcontents it is deleting fine. The
selection.Delete is working fine for remaining workbooks. can any one give
your opinion about this.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Problem of selection.delete

Is the sheet protected in any way (ToolsProtection)?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Radhakrishna k.v.n.r" wrote in
message ...
Hi all,
we are currently using MSExcel 2003 version. We are facing a problem of
deleting perticular data by selecting the range. We are first selecting
the
specified range and we are doing the selection.delete operation using
macro.
But it is selecting the range but it is not deleting. If i gave
selection.clearformats and selection.clearcontents it is deleting fine.
The
selection.Delete is working fine for remaining workbooks. can any one give
your opinion about this.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Problem of selection.delete

Selection.Delete should also include the direction to shift cells otherwise
Excel decides. I wonder if this is causing a problem. Options a-

Selection.Delete Shift:=xlUp

Selection.Delete Shift:=xlToLeft

Selection.EntireRow.Delete

Selection.EntireColumn.Delete



Based on your other comments re clear, I suppose you really do want to
delete which removes the rows or columns within the selection and places the
columns to the right or rows from below in their place. Selection.Clear just
removes the data out of the cells.

Regards,

OssieMac





"Radhakrishna k.v.n.r" wrote:

Hi all,
we are currently using MSExcel 2003 version. We are facing a problem of
deleting perticular data by selecting the range. We are first selecting the
specified range and we are doing the selection.delete operation using macro.
But it is selecting the range but it is not deleting. If i gave
selection.clearformats and selection.clearcontents it is deleting fine. The
selection.Delete is working fine for remaining workbooks. can any one give
your opinion about this.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Problem of selection.delete

Thank u all for immediate response.

The sheet is not protected.
And we are deleting all the contents in the entire region and we need to
copy new contents from other sheet.

We selected the Range and gave selection.delete. but this is not deleting
the contents which is causing problem.

But if we give selection.clearcontents, it is working.
We are little bit confused of this behaviour.

Please help us.

Thanks,
Radhakrishna

"OssieMac" wrote:

Selection.Delete should also include the direction to shift cells otherwise
Excel decides. I wonder if this is causing a problem. Options a-

Selection.Delete Shift:=xlUp

Selection.Delete Shift:=xlToLeft

Selection.EntireRow.Delete

Selection.EntireColumn.Delete



Based on your other comments re clear, I suppose you really do want to
delete which removes the rows or columns within the selection and places the
columns to the right or rows from below in their place. Selection.Clear just
removes the data out of the cells.

Regards,

OssieMac





"Radhakrishna k.v.n.r" wrote:

Hi all,
we are currently using MSExcel 2003 version. We are facing a problem of
deleting perticular data by selecting the range. We are first selecting the
specified range and we are doing the selection.delete operation using macro.
But it is selecting the range but it is not deleting. If i gave
selection.clearformats and selection.clearcontents it is deleting fine. The
selection.Delete is working fine for remaining workbooks. can any one give
your opinion about this.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Problem of selection.delete

Like I said, delete moves other columns or rows into its place. Use
Selection.Clear if you want to copy other data into its place.

Regards,

OssieMac

"Radhakrishna k.v.n.r" wrote:

Thank u all for immediate response.

The sheet is not protected.
And we are deleting all the contents in the entire region and we need to
copy new contents from other sheet.

We selected the Range and gave selection.delete. but this is not deleting
the contents which is causing problem.

But if we give selection.clearcontents, it is working.
We are little bit confused of this behaviour.

Please help us.

Thanks,
Radhakrishna

"OssieMac" wrote:

Selection.Delete should also include the direction to shift cells otherwise
Excel decides. I wonder if this is causing a problem. Options a-

Selection.Delete Shift:=xlUp

Selection.Delete Shift:=xlToLeft

Selection.EntireRow.Delete

Selection.EntireColumn.Delete



Based on your other comments re clear, I suppose you really do want to
delete which removes the rows or columns within the selection and places the
columns to the right or rows from below in their place. Selection.Clear just
removes the data out of the cells.

Regards,

OssieMac





"Radhakrishna k.v.n.r" wrote:

Hi all,
we are currently using MSExcel 2003 version. We are facing a problem of
deleting perticular data by selecting the range. We are first selecting the
specified range and we are doing the selection.delete operation using macro.
But it is selecting the range but it is not deleting. If i gave
selection.clearformats and selection.clearcontents it is deleting fine. The
selection.Delete is working fine for remaining workbooks. can any one give
your opinion about this.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Problem of selection.delete

Thanks. As you said, selection.clear is working.

We are also analyzing the issue with the following delete code. there is no
data at the bottom (or side) of the region we selected for deletion. As u
said, even if delete moves the column/row after deletion, theoretically it
shouldnot affect us.

Our code:
Range("A4","IV65000").select
selection.delete

This code is working in Excel2007 but in excel 2003 it is working for
somesheets and not for other( inconsistent behaviour).


Any idea pls?

"OssieMac" wrote:

Like I said, delete moves other columns or rows into its place. Use
Selection.Clear if you want to copy other data into its place.

Regards,

OssieMac

"Radhakrishna k.v.n.r" wrote:

Thank u all for immediate response.

The sheet is not protected.
And we are deleting all the contents in the entire region and we need to
copy new contents from other sheet.

We selected the Range and gave selection.delete. but this is not deleting
the contents which is causing problem.

But if we give selection.clearcontents, it is working.
We are little bit confused of this behaviour.

Please help us.

Thanks,
Radhakrishna

"OssieMac" wrote:

Selection.Delete should also include the direction to shift cells otherwise
Excel decides. I wonder if this is causing a problem. Options a-

Selection.Delete Shift:=xlUp

Selection.Delete Shift:=xlToLeft

Selection.EntireRow.Delete

Selection.EntireColumn.Delete



Based on your other comments re clear, I suppose you really do want to
delete which removes the rows or columns within the selection and places the
columns to the right or rows from below in their place. Selection.Clear just
removes the data out of the cells.

Regards,

OssieMac





"Radhakrishna k.v.n.r" wrote:

Hi all,
we are currently using MSExcel 2003 version. We are facing a problem of
deleting perticular data by selecting the range. We are first selecting the
specified range and we are doing the selection.delete operation using macro.
But it is selecting the range but it is not deleting. If i gave
selection.clearformats and selection.clearcontents it is deleting fine. The
selection.Delete is working fine for remaining workbooks. can any one give
your opinion about this.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Problem of selection.delete

Now that I know the range you are trying to delete, my first thoughts are
that the memory of the computer cannot handle it. Perhaps some of the
computers have more spare resources than others. (xl2207 is designed to
handle a great deal more data.)

Personally I would use something like the following instead of trying to
select almost the entire worksheet. It finds the cell where the last used
column and last used row intersect. Also I would avoid using Delete unless
there is a real reason to do so.

Sub Last_Used_Cell()

Dim rngLastUsed As Range

With ActiveSheet.UsedRange
Set rngLastUsed = .Cells(.Rows.Count, .Columns.Count)
End With

Range("A4", rngLastUsed).Select

End Sub


Regards,

OssieMac


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Problem of selection.delete

Thank you very much.

"OssieMac" wrote:

Now that I know the range you are trying to delete, my first thoughts are
that the memory of the computer cannot handle it. Perhaps some of the
computers have more spare resources than others. (xl2207 is designed to
handle a great deal more data.)

Personally I would use something like the following instead of trying to
select almost the entire worksheet. It finds the cell where the last used
column and last used row intersect. Also I would avoid using Delete unless
there is a real reason to do so.

Sub Last_Used_Cell()

Dim rngLastUsed As Range

With ActiveSheet.UsedRange
Set rngLastUsed = .Cells(.Rows.Count, .Columns.Count)
End With

Range("A4", rngLastUsed).Select

End Sub


Regards,

OssieMac


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
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Selection.Replace Problem Dave Excel Discussion (Misc queries) 8 September 20th 07 06:23 PM
Delete Entry Based on Selection AntnyMI Excel Discussion (Misc queries) 1 September 16th 06 06:24 PM
Selection mode problem Richard L. Trethewey New Users to Excel 2 November 23rd 05 07:45 PM
Macro data selection line delete Frantic Excel-er Excel Discussion (Misc queries) 0 May 31st 05 11:46 PM


All times are GMT +1. The time now is 11:09 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"