开发者

Select a range in Excel vbscript

开发者 https://www.devze.com 2023-03-02 20:19 出处:网络
Using vbScript, I use the find method to search a named range for a cell value开发者_Go百科 and select that item in the worksheet if the value is found.What I need to do is select a range of cells sta

Using vbScript, I use the find method to search a named range for a cell value开发者_Go百科 and select that item in the worksheet if the value is found. What I need to do is select a range of cells starting with the "found" cell and extending to the top row in the column and from the found cell to the bottom of the column. So, if my found cell is A15 then I want to select the range that is A14 through A1 and from A16 to the bottom of the column. I've been kicking this can down the road far to long. Can someone help. Thanks in advance.


EndCell = "A14" ' You of course have to find A14 using your search function   
Range("A1:"&EndCell).Select


Columns(FoundCell.Column).Select
0

精彩评论

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