ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   selecting multiple cell in a roll that falls withing a range (https://www.excelbanter.com/charts-charting-excel/135050-selecting-multiple-cell-roll-falls-withing-range.html)

Olamide

selecting multiple cell in a roll that falls withing a range
 
Gentlemen,

Using VBA, is it posible to select all the cells in column A which their
value fall in between 5 and 10
i.e select all cells in columnA =5 and =< 10




Bernard Liengme

selecting multiple cell in a roll that falls withing a range
 
The subrountine below will do that, but if you just want to highlight them
do you know about Conditional Formatting?

Sub Check()
myrange = ""
For j = 1 To 100
mytest = Cells(j, 1).Value
If mytest = 5 And mytest <= 10 Then
myrange = myrange & "A" & j & ","
End If
Next j
myrange = Mid(myrange, 1, Len(myrange) - 1)
'MsgBox myrange
Range(myrange).Select
End Sub

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Olamide" wrote in message
...
Gentlemen,

Using VBA, is it posible to select all the cells in column A which their
value fall in between 5 and 10
i.e select all cells in columnA =5 and =< 10







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

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