ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   set range question (https://www.excelbanter.com/excel-programming/292216-set-range-question.html)

David Goodall

set range question
 
Hi,
I've written the following code and would like to improve it.

sub cellchecker()
Dim CellsToBeChecked As Range
Set CellsToBeChecked = Range("B1:B2500") - the range contains a list of
names
further code.....
end sub

I only actually need to check cells that contain names and the list of names
can vary for 20 to 2500.I would like to be able to alter the set range
upper limit accordingly.

I hope that makes sense.

Many thanks
David



Colo[_97_]

set range question
 
Hi David,

Set the range as below or please look into the word "Specialcells" i
the VBA help.


Code
-------------------

Set CellsToBeChecked = Range(Range("B1"), Range("B65536").End(xlUp))

-------------------


--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com