Excel VBA data concatenation

Hi,
  I would like to get assistance with VBA coding to perform data concatenation in an Excel spread sheet.
Please see the attached file for problem statement and screen shots. Please let me know if you need more clarification or have any

questions.

Thanks in advance.
EE-Data-concatenation.docx
tesla764Asked:
Who is Participating?
 
Robberbaron (robr)Connect With a Mentor Commented:
please check my logic...

start at row 3, Column B.  (cellStart)
   find the next cell in Row 3 that has green background. RGB(220, 230, 241) (cellEnd)
      start a new dataConcatenation=""

      for each [i]cellX [/i]in Row 4 up to cellEnd
           if cellX is not part of the cellStart columnspan (coloured) then 
                if cellX value is "Regulatory", add value to  dataConcatenation
      next cellX
      
     write dataConcatenation value to cell above [cellStart]

  loop until end of row.

Open in new window

0
 
tesla764Author Commented:
Basic logic flow...
Check row 3 - Find cell that has Green fill color.
Next column
  if row 3 cell is not Green then
  check row 4 for "Regulatory"
  When "Regulatory" is found
    copy (concatenate) the value in that column data to the column to the left (Column with Green fill in row 3), that has the word "Regulatory"
This concatenation will take plae until the Green fill color is encountered (row 3)
0
 
Robberbaron (robr)Connect With a Mentor Commented:
1. so you will have lots of columns to process ?  eg beyond Z

2. And only one row or a number of rows as well ?

3. do you want this to happen as you change cells or is it ok to have a button <Update Now>

please post a test workbook rather than word screenshots.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
Berkson WeinConnect With a Mentor Tech FreelancerCommented:
I also agree, please post an excel sheet.  Your description isn't particularly clear.  Seeing the actual xlsx document will help for sure.
0
 
tesla764Author Commented:
0
 
tesla764Author Commented:
If you put all 3 attached files in c:\temp this should work.
DRA-PDS-Audit.accdb
0
 
tesla764Author Commented:
Workbook and db files have been provided. Do they work alright for you?
0
 
Robberbaron (robr)Connect With a Mentor Commented:
had to make some changes to the hardcoded paths but get it to open.

do you need the function to occur upon workbook open like the other code or by a button on the sheet.  I'll attempt the later as should be able to be independent of startup.
0
 
tesla764Author Commented:
That's fine.
0
 
Robberbaron (robr)Connect With a Mentor Commented:
I cant get the Country recordset to populate.... no ISAM yet the question list does.

so i cant get any data to match your example..

can you save the example in the doc file as values only ?

copy all the cells on the sheet and then paste-as-values to a new sheet.
0
 
Robberbaron (robr)Connect With a Mentor Commented:
is AggregateColumnValues the function you want extended ?

it seems to be joining cells based upon color.
0
 
tesla764Author Commented:
Yes your logic is correct.
0
 
tesla764Author Commented:
The actual Green color is...
RGB(153, 255, 51)
0
 
tesla764Author Commented:
I can provide you with the workbook and a scaled down version of the DB if you would prefer.
0
 
Robberbaron (robr)Commented:
1/ just the workbook, with data in it.  Copy and paste <as-values> to leave out the db.  we can then work on the aggregation in isolation.

2/ the color is just from the current code.
0
 
tesla764Author Commented:
This is the workbook that is the result of selecting the criteria.
DRA-Summary.xlsx
0
 
Robberbaron (robr)Commented:
here is my test1 , i am missing part of your request i guess.

1/ is the summary supposed to be just one of each text found ?
2/ is it supposed to be all cells in the 'Regualtory' column ?  ie multiple rows ?

can you draw arrows from the cells that are to make up the summary ?
DRA-Summary1.xlsm
0
 
tesla764Author Commented:
Here is a simplified, straight forward synopsis of this request...

Background...
The cells in row 3, the green  fill color is RGB(153,255,51)
The cells in row 4, the yellow fill color is RGB(255,255,0)
Note - In this screen shot the TEXT in the 1st green cell is
"GQ-005 - Approval Time"
            and the next green cell has
"GQ-008 - GMP Certificate"

Process…
In the area BETWEEN the cells that have the green RGB(153,255,51), in this case Columns D to W...
I want to copy the value in column "E" (Not Applicable) to column "A"
     Then copy the value in column "O" (3 Months)       to column "A"  (appended)

•      Note that the column data that gets appended has the word "Regulatory" in the header with the yellow fill color.
•      Note that there is a third occurrence of "Regulatory", the data in that column contains "3 Months" which has already been appended, there should be no duplicate data that gets appended.

Please refer to the spreadsheet that is attached “GQ Spreadsheet.xlsx” when reading this problem statement.

Hopefully this is clear. If not please ask any questions you may have.
Thanks for your help in advance.
GQ-Spreadsheet.xlsx
0
 
tesla764Author Commented:
Thanks everybody for your participation.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.