473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How Do I aggregate rows up when there value is Yes?

103 100+
I have an excel sheet where there are a lot of columnst that have either Yes, No and Null Values. Going down the list there are companies and they may appear multiple times, however the columns may have different values. I want to loop through the repeat company's values and if they are yes, paste the value into the first appearance of the company's name. For example, Company A appears three times. I want to loop trought the 2nd and third time and if there is a value of yes, copy and paste it into the first time appearance in the same column. I paste a sample view below.


Before View
Expand|Select|Wrap|Line Numbers
  1. <table border="1">
  2. <tr>
  3. <td>Company</td>
  4. <td>A</td>
  5. <td>A</td>
  6. <td>A</td>
  7. <td>B</td>
  8. </tr>
  9. <tr>
  10. <td>Value 1</td>
  11. <td>Yes</td>
  12. <td>No</td>
  13. <td>No</td>
  14. <td>Yes</td>
  15. </tr>
  16. <tr>
  17. <td>Value 2</td>
  18. <td>No</td>
  19. <td>Yes</td>
  20. <td>No</td>
  21. <td>Yes</td>
  22. </tr>
  23. <tr>
  24. <td>Value 3</td>
  25. <td>Yes</td>
  26. <td>No</td>
  27. <td>No</td>
  28. <td>Yes</td>
  29. </tr>
  30. </table> 
  31.  
  32.  

After VBA Code View
Expand|Select|Wrap|Line Numbers
  1. <table border="1">
  2. <tr>
  3. <td>Company</td>
  4. <td>A</td>
  5. <td>B</td>
  6. </tr>
  7. <tr>
  8. <td>Value 1</td>
  9. <td>Yes</td>
  10. <td>Yes</td>
  11. </tr>
  12. <tr>
  13. <td>Value 2</td>
  14. <td>Yes</td>
  15. <td>Yes</td>
  16. </tr>
  17. <tr>
  18. <td>Value 3</td>
  19. <td>Yes</td>
  20. <td>Yes</td>
  21. </tr>
  22. </table> 
  23.  
Jul 17 '12 #1
2 24947
zmbd
5,501 Expert Mod 4TB
Brain,
Required reading before you post: How to ask good questions - Read before submitting question

I'm not too sure how much help you're going to get here as this is an MS-Access forum.

I can only guess that your two code blocks are your Excel worksheets? In order to even begin to help I (read any of the experts/mods/users) would have to translate these - they are not usable as is!

Next, What have you tried to do? How have you tried to solve this problem? What specific error are you running in to?

-z
Jul 17 '12 #2
Brian Connelly
103 100+
Yes, I made a lot of head way. This post has been changed and added to Visual Basic. And I made a mistake, I saw VBA and read VBE which is why I posted here.
Jul 18 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ruel | last post by:
Is there an equivalent to the "Break When Value is True" Watch option in .NET. I have yet to discover it.
9
by: garima puri | last post by:
hi ihad made a form in which dynamic rows are added to a table. now when i send there values to next page by GETmethod then in between alphabets where space is given + is shown and where new line...
3
by: MrNobody | last post by:
I've read that the expression property for DataColumns is used to "Sets or retrieves the expresssion used to filter rows, calculate the values in a column, or create an aggregate column.". I...
3
by: liscete | last post by:
I have 3 columns: cost, promo_date, order_date. If order_date is not blank: for each order_date i need to sum all costs as long as order_date - promo_date is less than 3 months. i looked at case...
1
by: prathna | last post by:
Hi .. I have a logic:iterate tag which will display 5 rows each row with a drop downlist and 2 textfields.now by default all the rows will be shown.how do i hide all the rows except the first...
7
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi, I have a table with no rows for the moment. table name = mytable rows = id, id1, qty id and id1 together is the primary key when i try tthe following select sum(qty) from mytable where id...
0
by: Naldo | last post by:
Hi there I'm trying to make a spreadsheet, which reads other spreadsheets and displays info accordingly. I'm stuck though. I read off one spreadsheet where I find the col required (row 1) then...
2
by: cday119 | last post by:
Hi Everyone, So I have a datagridview and it has a column called status. It has 3 values: New, Printed, and Shipped. Now a user can select multiple rows and click "set to printed". I then do...
1
by: gordon57 | last post by:
Hi everybody, i'm doing a query where i want retrieve some records when i do the query without 'limit' the result returns me the correct number of rows, but when i use limit the result returns me the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.