Excel resetting “UsedRange”

前端 未结 12 2129
醉酒成梦
醉酒成梦 2021-01-05 15:42

Don\'t know what I\'m missing, but the examples I see posted do not appear to work.

I import data from a web query. I set the query to clear unused cells when it re

12条回答
  •  没有蜡笔的小新
    2021-01-05 15:57

    I've used Jeeped solution and worked for me when i add .Activate, so:

    With Worksheets("Sheet1")
            Debug.Print .UsedRange.Address(0, 0)
            .UsedRange.Clear
            .UsedRange   
            .Activate
            Debug.Print .UsedRange.Address(0, 0)
      End With
    

    I'm using Excel2013

提交回复
热议问题