Excel VBA剪切后删除空白行 [英] Excel VBA remove blank row after cut

查看:87
本文介绍了Excel VBA剪切后删除空白行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这段代码,可将整行剪切并粘贴到另一张纸上,如何删除现在出现在剪切原始行的第一张纸上的空白行.

I have this code which cuts and pastes an entire row to another sheet, how could I remove the blank row which now appears on the first sheet in which the original row was cut.

Set ASR = ActiveWorkbook.Sheets("Main")
Set LS = ActiveWorkbook.Sheets("Exclusions")

ASR.cells(i, "C").EntireRow.Cut Destination:=LS.Range("A" & LS.Rows.Count).End(xlUp).Offset(1)

我希望从 answer 获得的这一行代码会删除空白行,但无效

I was hoping this line of code which I got from this answer would remove the blank rows, but it did not work

ASR.cells.Delete Shift:=xlUp

推荐答案

ASR.cells(i,"C").EntireRow.delete

这篇关于Excel VBA剪切后删除空白行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆