Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Last cell in range of formulas not equal to blank

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shawn - 26 Mar 2008 13:03 GMT
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.

Signature

Thanks
Shawn

Gary''s Student - 26 Mar 2008 13:21 GMT
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

Signature

Gary''s Student - gsnu200775

> 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
[quoted text clipped - 4 lines]
>
> Help.
Shawn - 26 Mar 2008 13:26 GMT
Thank you.  Can you help me one step farther?  I want to go to that cell and
select the range A1: that cell???
Signature

Thanks
Shawn

> Sub find_it()
> mesage = ""
[quoted text clipped - 16 lines]
> >
> > Help.
Gary''s Student - 26 Mar 2008 13:38 GMT
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
Signature

Gary''s Student - gsnu200775

> Thank you.  Can you help me one step farther?  I want to go to that cell and
> select the range A1: that cell???
[quoted text clipped - 19 lines]
> > >
> > > Help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.