#1   Report Post  
Posted to microsoft.public.excel.misc
Gingit
 
Posts: n/a
Default Extracting data

Thanks jindon I'll try it.

Gingit

"jindon" wrote:


Gingit Wrote:
A B C D
1 Toyota Chev Buick
2 xxxyz 500 100
3 trxxx 300
4 yyzsz 200

I have a sample of the following spreadsheet. I want to extract out
only
the data that matches columns B-D and the number. In other words I
want to
make a list that matches a car with the data and only lists if it has
data
assoicated with it.
For ex. give me Toyota and xxxyz but I don't wont Toyota and trxxx
since it
has no data associated with it.

Thanks in advance.

The code below will change the data, so make back-up file before you
run.

Code:
--------------------

Sub test()
Dim a, result(), i As Integer, ii As Integer, n As Integer
With Range("a1").CurrentRegion
a = .Value
.Celar
End With
For ii = 2 To UBound(a,2)
For i = 2 To UBound(a, 1)
If Not IsEmpty(a(i, ii)) Then
n = n + 1
Redim Preserve result(1 To 2, 1 To n)
result(1, n) = a(1, ii)
result(2, n) = a(i, 1)
End If
Next
Next
Range("a1").Resize(n, 2) = result
Erase a, result
End Sub
--------------------


--
jindon
------------------------------------------------------------------------
jindon's Profile: http://www.excelforum.com/member.php...o&userid=13135
View this thread: http://www.excelforum.com/showthread...hreadid=551706


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
Pull data from another sheet based on certain criteria steve_sr2 Excel Discussion (Misc queries) 1 February 23rd 06 10:08 AM
ranking query JaimeTimbrell Excel Discussion (Misc queries) 2 February 16th 06 08:09 AM
Extracting data from two columns Dan Excel Discussion (Misc queries) 4 October 5th 05 04:42 AM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM


All times are GMT +1. The time now is 03:58 PM.

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

About Us

"It's about Microsoft Excel"