简体   繁体   中英

LastRow + Range

I have unusual question. How to use lastrow in Range but instead to define end of some range, just the beginning of a range? See below.

In my code they are some "empty" cells that are not entirely empty and it causes some problems. I have tried that code to delete them:

With ActiveSheet
   Range("A1:L20001").Value = Evaluate("IF(ROW(" & .UsedRange.Address & "),CLEAN(" & .UsedRange.Address & "))")
End With

But in label software they are still somehow there and the only option is to delete whole "empty" range manually.

Usual application for LastRow: .Range("A2:N" & LastRow)

But I need something like this:

.Range("A" & LastRow &":N200001")

您可以使用:

.Range(.Cells(LastRow ,"A"), .Cells(200001,"N")).Value = .....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM