Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
ojv ojv is offline
external usenet poster
 
Posts: 4
Default 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
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
VBA code for Extracting Data but order of columns changes all the Confused Excel Discussion (Misc queries) 3 April 8th 08 05:16 AM
extracting data from a spreadsheet by searching on columns Tom New Users to Excel 3 October 24th 05 10:36 PM
Extracting data from two columns Dan Excel Discussion (Misc queries) 4 October 5th 05 04:42 AM
Extracting data from other columns Polar Excel Worksheet Functions 0 February 10th 05 12:07 PM
Extracting data from one row across multiple columns to form a lis vakant Excel Programming 0 September 6th 04 03:33 PM


All times are GMT +1. The time now is 06:26 PM.

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"