Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting data from one row across multiple columns
I've got a worksheet containing the data extracted from
an electronic questionnaire, each set of answers are contained in one column with each quesion answer on a separate row. I need to find a way of looking up all the answers from one particular question (i.e. the data from the same row of multiple columns) and then extracting these in the form of a list without duplicates. Can anyone help? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extracting data from one row across multiple columns
Maybe the code below helps
Loops through each cell in the range rngAns and store unique values in the vector Answers(). You can f.i. use Application.InputBox to get the range you need. Dim Answers(), cl as range, i as integer, j as integer Dim inlist as boolean i=1 set rngAns=range(cells(row,colStart),cells(row,colEnd) ) redim answers(1 to rngAns.columns.count) for each cl in rngAns inlist=false if i1 for j=1 to i if answers(j)="" then exit for if answers(j)=cl.value then inlist=true:exit for next endif if not inlist then answers(i)=cl.value:i=i+1 next redim preserve answers(1 to i-1) -----Original Message----- I've got a worksheet containing the data extracted from an electronic questionnaire, each set of answers are contained in one column with each quesion answer on a separate row. I need to find a way of looking up all the answers from one particular question (i.e. the data from the same row of multiple columns) and then extracting these in the form of a list without duplicates. Can anyone help? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA code for Extracting Data but order of columns changes all the | Excel Discussion (Misc queries) | |||
extracting data from a spreadsheet by searching on columns | New Users to Excel | |||
Extracting data from two columns | Excel Discussion (Misc queries) | |||
Extracting data from other columns | Excel Worksheet Functions | |||
Extracting data from one row across multiple columns to form a lis | Excel Programming |