Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default return multiple cell references

My sheet could have anywhere from 1 to 200 rows.

A B C
1 Jones 9 8
2 Smith 3
3 Jones 6 6
4 Clark 4 3
5 Young 1 1

There's alot of other data in numerous sheets which gets summarized on one
sheet. From this sheet I need to find the row numbers is C0 and B<C. The
problem is I need a one line answer for the summary sheet (ex - The following
rows have errors: 1, 4). Is there anyway to do this? Due to the way my data
is compiled, I am unable to use Data Validation.

Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default return multiple cell references

How about an alternative.

Add headers in row 1.
Add an new column with formulas like:
=if(and(c22,b2<c2),"Error","")

And then drag down the column.

Select that new column and do Data|Filter|Autofilter to show just the Error's.

laszlo wrote:

My sheet could have anywhere from 1 to 200 rows.

A B C
1 Jones 9 8
2 Smith 3
3 Jones 6 6
4 Clark 4 3
5 Young 1 1

There's alot of other data in numerous sheets which gets summarized on one
sheet. From this sheet I need to find the row numbers is C0 and B<C. The
problem is I need a one line answer for the summary sheet (ex - The following
rows have errors: 1, 4). Is there anyway to do this? Due to the way my data
is compiled, I am unable to use Data Validation.

Thanks!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default return multiple cell references

For a single line summary, run this macro:

Sub laszlo()
Dim n As Long, m As Integer
Dim bv As Integer, cv As Integer
n = Cells(Rows.Count, "A").End(xlUp).Row
messagee = "The following rows have errors: "
For i = 1 To n
bv = Cells(i, "B").Value
cv = Cells(i, "C").Value
If cv 0 And bv < cv Then
messagee = messagee & i & ", "
End If
Next
Range("D1").Value = Left(messagee, Len(messagee) - 2)
End Sub

--
Gary''s Student - gsnu200742


"laszlo" wrote:

My sheet could have anywhere from 1 to 200 rows.

A B C
1 Jones 9 8
2 Smith 3
3 Jones 6 6
4 Clark 4 3
5 Young 1 1

There's alot of other data in numerous sheets which gets summarized on one
sheet. From this sheet I need to find the row numbers is C0 and B<C. The
problem is I need a one line answer for the summary sheet (ex - The following
rows have errors: 1, 4). Is there anyway to do this? Due to the way my data
is compiled, I am unable to use Data Validation.

Thanks!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default return multiple cell references

Thank you so much! I added this to my existing (& very elementary) macro and
it worked out great. One thing though... what can I do if none of the rows
have errors? If there a way to have no message?

"Gary''s Student" wrote:

For a single line summary, run this macro:

Sub laszlo()
Dim n As Long, m As Integer
Dim bv As Integer, cv As Integer
n = Cells(Rows.Count, "A").End(xlUp).Row
messagee = "The following rows have errors: "
For i = 1 To n
bv = Cells(i, "B").Value
cv = Cells(i, "C").Value
If cv 0 And bv < cv Then
messagee = messagee & i & ", "
End If
Next
Range("D1").Value = Left(messagee, Len(messagee) - 2)
End Sub

--
Gary''s Student - gsnu200742


"laszlo" wrote:

My sheet could have anywhere from 1 to 200 rows.

A B C
1 Jones 9 8
2 Smith 3
3 Jones 6 6
4 Clark 4 3
5 Young 1 1

There's alot of other data in numerous sheets which gets summarized on one
sheet. From this sheet I need to find the row numbers is C0 and B<C. The
problem is I need a one line answer for the summary sheet (ex - The following
rows have errors: 1, 4). Is there anyway to do this? Due to the way my data
is compiled, I am unable to use Data Validation.

Thanks!


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default return multiple cell references

Thanks for responding. I had tried that formula too although I had forgotten
about the autofilter function. This is a monthly spreadsheet so I wanted
something that would calculate automatically each time the sheet was updated.
I already have a macro in it to create the summary sheet, so I was able to
incorporate Gary"s Student's suggestion. Now I just need to figure out how
to skip the error message if there are no errors.

Thanks again!

"Dave Peterson" wrote:

How about an alternative.

Add headers in row 1.
Add an new column with formulas like:
=if(and(c22,b2<c2),"Error","")

And then drag down the column.

Select that new column and do Data|Filter|Autofilter to show just the Error's.

laszlo wrote:

My sheet could have anywhere from 1 to 200 rows.

A B C
1 Jones 9 8
2 Smith 3
3 Jones 6 6
4 Clark 4 3
5 Young 1 1

There's alot of other data in numerous sheets which gets summarized on one
sheet. From this sheet I need to find the row numbers is C0 and B<C. The
problem is I need a one line answer for the summary sheet (ex - The following
rows have errors: 1, 4). Is there anyway to do this? Due to the way my data
is compiled, I am unable to use Data Validation.

Thanks!


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple cell references Tia Excel Worksheet Functions 0 February 21st 07 05:55 PM
Function(s) that return multiple separated references akullen Excel Worksheet Functions 2 March 16th 06 02:47 PM
I cant get Excel OFFSET Fnct to return multiple references. dmkirk Charts and Charting in Excel 2 October 15th 05 01:58 PM
How do I put multiple references in the same cell? MosesX8 Excel Worksheet Functions 3 June 10th 05 09:49 PM
Return Cell References Craig Excel Worksheet Functions 1 February 17th 05 02:32 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"