ukdane
10-21-2009, 11:49 PM
I have a worksheet with a series of rows.
I have a delete row button.
If the user selects a single cell, then the button deletes the entire row.
Job done!
BUT if the user selects more than one cell - in a different row, then I need it to delete each row that has been selected.
I assume I can use Selection.EntireRow.Delete to delete each row.
The other part of the problem, is that another part of the workbook needs to know how many cells/rows have been selected, in order to adjust the total number of rows available. I thought I could use mynrselection = Selection.Count, but if I select 3 cells, (either in 3 adjacent cells or not), when I debug, the variable returns "6".
Any ideas?
Cheers
I have a delete row button.
If the user selects a single cell, then the button deletes the entire row.
Job done!
BUT if the user selects more than one cell - in a different row, then I need it to delete each row that has been selected.
I assume I can use Selection.EntireRow.Delete to delete each row.
The other part of the problem, is that another part of the workbook needs to know how many cells/rows have been selected, in order to adjust the total number of rows available. I thought I could use mynrselection = Selection.Count, but if I select 3 cells, (either in 3 adjacent cells or not), when I debug, the variable returns "6".
Any ideas?
Cheers