I have a database with plenty of data. Suddenly I needed to delete a specific range but each time i deleted that range an error pops up.
excel error "-2147417848" Is there an issue with names? comments? anything? I wrote a sub to illustrate. thanks.
I have a database with plenty of data. Suddenly I needed to delete a specific range but each time i deleted that range an error pops up.
excel error "-2147417848" Is there an issue with names? comments? anything? I wrote a sub to illustrate. thanks.
This is strange indeed. I experimented a bit, and found the following:I suspect something is hiding in the worksheet, an unseen remainder of a formatting operation or another. If you need to somehow get rid of it.
- If you try to delete columns B: DZ manually (i.e. from menu), Excel crashes and wants to report error to Microsoft.
- You can delete the range in parts, (e.g. first columns AA: DZ then columns B:Z) without crash.
- If you select any column and clear its formatting, then you can delete columns B: DZ without crash. The "unformatted" column can be any one, doesn't have to be within B: DZ
- If you clear the format of row #4, you can delete columns B: DZ without crash. Other rows are irrelevant.
- Examining row #4 more closely revealed that this problem is probably rooted in merged cells. I have not found any merged cells in row #4. However, if you select row #4, merge its cells then unmerge them, then you can delete columns B: DZ without crash.
Alternatively, you can use this workaround:
[vba]Sub Delete()
Columns("CZ").Delete
Columns("B:B").Delete
End Sub
[/vba]
HTH
Jimmy
-------------------------------------------------
The more details you give, the easier it is to understand your question. Don't save the effort, tell us twice rather than not at all. The amount of info you give strongly influences the quality of answer, and also how fast you get it.