ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Last cell in range of formulas not equal to blank (https://www.excelbanter.com/excel-programming/408329-last-cell-range-formulas-not-equal-blank.html)

Shawn

Last cell in range of formulas not equal to blank
 
I have a range: A1:E10. Every cell in this range has a formula in it that
looks in other sheets and makes calculations. If the cell value is 0 it
leaves the cell blank.

I want to find the last cell (bottom right) in this range that does not
equal "blank".

Help.



--
Thanks
Shawn

Gary''s Student

Last cell in range of formulas not equal to blank
 
Sub find_it()
mesage = ""
Set r = Range("A1:E10")
For Each rr In r
If rr.Value = "" Then
Else
mesage = rr.Address
End If
Next
MsgBox (mesage)
End Sub

--
Gary''s Student - gsnu200775


"Shawn" wrote:

I have a range: A1:E10. Every cell in this range has a formula in it that
looks in other sheets and makes calculations. If the cell value is 0 it
leaves the cell blank.

I want to find the last cell (bottom right) in this range that does not
equal "blank".

Help.



--
Thanks
Shawn


Shawn

Last cell in range of formulas not equal to blank
 
Thank you. Can you help me one step farther? I want to go to that cell and
select the range A1: that cell???
--
Thanks
Shawn


"Gary''s Student" wrote:

Sub find_it()
mesage = ""
Set r = Range("A1:E10")
For Each rr In r
If rr.Value = "" Then
Else
mesage = rr.Address
End If
Next
MsgBox (mesage)
End Sub

--
Gary''s Student - gsnu200775


"Shawn" wrote:

I have a range: A1:E10. Every cell in this range has a formula in it that
looks in other sheets and makes calculations. If the cell value is 0 it
leaves the cell blank.

I want to find the last cell (bottom right) in this range that does not
equal "blank".

Help.



--
Thanks
Shawn


Gary''s Student

Last cell in range of formulas not equal to blank
 
We can do either, but I don't know how to do both at the same time. This
will select the Found cell:

Sub find_it()
mesage = ""
Set rGoTo = Range("A1")
Set r = Range("A1:E10")
For Each rr In r
If rr.Value = "" Then
Else
mesage = rr.Address
Set rGoTo = rr
End If
Next
rGoTo.Select
End Sub

This version selects the area from A1 thru the Found cell:

Sub find_it()
mesage = ""
Set rGoTo = Range("A1")
Set r = Range("A1:E10")
For Each rr In r
If rr.Value = "" Then
Else
mesage = rr.Address
Set rGoTo = rr
End If
Next
Range("A1:" & mesage).Select
End Sub
--
Gary''s Student - gsnu200775


"Shawn" wrote:

Thank you. Can you help me one step farther? I want to go to that cell and
select the range A1: that cell???
--
Thanks
Shawn


"Gary''s Student" wrote:

Sub find_it()
mesage = ""
Set r = Range("A1:E10")
For Each rr In r
If rr.Value = "" Then
Else
mesage = rr.Address
End If
Next
MsgBox (mesage)
End Sub

--
Gary''s Student - gsnu200775


"Shawn" wrote:

I have a range: A1:E10. Every cell in this range has a formula in it that
looks in other sheets and makes calculations. If the cell value is 0 it
leaves the cell blank.

I want to find the last cell (bottom right) in this range that does not
equal "blank".

Help.



--
Thanks
Shawn



All times are GMT +1. The time now is 11:16 PM.

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