开发者

Macro to delete row in 2007 not working same working in 2003

开发者 https://www.devze.com 2023-02-22 23:02 出处:网络
This code is calling only one time when I open my excel sheet. The开发者_C百科 copy of data from one sheet to another sheet working just above the deletion code shown below. if I run the macro again t

This code is calling only one time when I open my excel sheet. The开发者_C百科 copy of data from one sheet to another sheet working just above the deletion code shown below. if I run the macro again then it is works as expected.

In 2003 both copying and deletion working when I open the sheet.

This is the code that is giving me problems:

Rows(ExceptionList & ":" & ExceptionList).Select 
Selection.Delete Shift:=xlUp


Is ExceptionList a String type?

I would avoid this whole string concatenation business and just say Rows(rowNumberToDelete).Delete Shift:=xlUp

Also, the whole .Select-Selection. vernacular is unnecessary and inefficient. That's how Excel machine-generates macros, but a thinking human shouldn't write like this.

0

精彩评论

暂无评论...
验证码 换一张
取 消