Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default How do i return muliple lines of data.

Hi,

I am totally stuck. I have an excel spreadsheet, and I want to do the
following

On Sheet2 field A2 is 23/11/2009.

I have a spreadsheet with lots of information in, and i want to find all
items that the date is 23/11/2009 and populate a new table. I want to display
actual data.
I am trying to set this up to run from a macro that has a pop up box to
enter the date. I can get the macro to work with a pop up box and I can get
it to pull one line with a vlookup, but I don't know how to pull mulitple
data.

Please help me!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default How do i return muliple lines of data.

Severl things at issue:

1. VLOOKUP() is a great way to grab data, but it only gets one value. To
get more than one value, see:

http://office.microsoft.com/en-us/ex...260381033.aspx


2. The usual method is to use AutoFilter:
a. set the filter
b. set the criteria ( hides or reveals rows)
c. copy the visible material
d. paste elsewhere

3. Because the AutoFilter approach can be implemented either manually or
programmatically, it can be integrated with your efforts. It is very fast,
even with large amounds of data.

4. Another approach is "brute farce" Just grind down the column in a loop
and gather the data as you find it.
--
Gary''s Student - gsnu200909


"Natalie" wrote:

Hi,

I am totally stuck. I have an excel spreadsheet, and I want to do the
following

On Sheet2 field A2 is 23/11/2009.

I have a spreadsheet with lots of information in, and i want to find all
items that the date is 23/11/2009 and populate a new table. I want to display
actual data.
I am trying to set this up to run from a macro that has a pop up box to
enter the date. I can get the macro to work with a pop up box and I can get
it to pull one line with a vlookup, but I don't know how to pull mulitple
data.

Please help me!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default How do i return muliple lines of data.

This would be fine, but none of your suggestions will work within a macro. I
think I have sorted it now. I used the macro to insert a new column, then if
the data matched the date, then put YES in. Then I can use autofilter! Seems
to work at the moment!

"Gary''s Student" wrote:

Severl things at issue:

1. VLOOKUP() is a great way to grab data, but it only gets one value. To
get more than one value, see:

http://office.microsoft.com/en-us/ex...260381033.aspx


2. The usual method is to use AutoFilter:
a. set the filter
b. set the criteria ( hides or reveals rows)
c. copy the visible material
d. paste elsewhere

3. Because the AutoFilter approach can be implemented either manually or
programmatically, it can be integrated with your efforts. It is very fast,
even with large amounds of data.

4. Another approach is "brute farce" Just grind down the column in a loop
and gather the data as you find it.
--
Gary''s Student - gsnu200909


"Natalie" wrote:

Hi,

I am totally stuck. I have an excel spreadsheet, and I want to do the
following

On Sheet2 field A2 is 23/11/2009.

I have a spreadsheet with lots of information in, and i want to find all
items that the date is 23/11/2009 and populate a new table. I want to display
actual data.
I am trying to set this up to run from a macro that has a pop up box to
enter the date. I can get the macro to work with a pop up box and I can get
it to pull one line with a vlookup, but I don't know how to pull mulitple
data.

Please help me!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default How do i return muliple lines of data.

try this code... It pastes to Sheet 2 but you can put the values where ever
makes your heart go pitter patter...

Sub FindStuff()
Dim rngTosearch As Range
Dim rngFound As Range
Dim rngFoundall As Range
Dim strWhat As String
Dim strFirst As String

strWhat = InputBox("Enter a date")
Set rngTosearch = Columns("A")
Set rngFound = rngTosearch.Find(What:=DateValue(strWhat), _
LookIn:=xlFormulas)
If Not rngFound Is Nothing Then
Set rngFoundall = rngFound
strFirst = rngFound.Address
Do
Set rngFoundall = Union(rngFound, rngFoundall)
Set rngFound = rngTosearch.FindNext(rngFound)
Loop Until rngFound.Address = strFirst
rngFoundall.EntireRow.Copy Sheet2.Range("A1") 'Change me
End If
End Sub

--
HTH...

Jim Thomlinson


"Natalie" wrote:

This would be fine, but none of your suggestions will work within a macro. I
think I have sorted it now. I used the macro to insert a new column, then if
the data matched the date, then put YES in. Then I can use autofilter! Seems
to work at the moment!

"Gary''s Student" wrote:

Severl things at issue:

1. VLOOKUP() is a great way to grab data, but it only gets one value. To
get more than one value, see:

http://office.microsoft.com/en-us/ex...260381033.aspx


2. The usual method is to use AutoFilter:
a. set the filter
b. set the criteria ( hides or reveals rows)
c. copy the visible material
d. paste elsewhere

3. Because the AutoFilter approach can be implemented either manually or
programmatically, it can be integrated with your efforts. It is very fast,
even with large amounds of data.

4. Another approach is "brute farce" Just grind down the column in a loop
and gather the data as you find it.
--
Gary''s Student - gsnu200909


"Natalie" wrote:

Hi,

I am totally stuck. I have an excel spreadsheet, and I want to do the
following

On Sheet2 field A2 is 23/11/2009.

I have a spreadsheet with lots of information in, and i want to find all
items that the date is 23/11/2009 and populate a new table. I want to display
actual data.
I am trying to set this up to run from a macro that has a pop up box to
enter the date. I can get the macro to work with a pop up box and I can get
it to pull one line with a vlookup, but I don't know how to pull mulitple
data.

Please help me!

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
Return two random lines Jeremy Excel Worksheet Functions 1 April 22nd 09 03:16 AM
IF, ADD TEXT. DELETE LINES AND RETURN VALUE... Candentco Creative Collection[_2_] Excel Worksheet Functions 0 June 7th 07 02:48 AM
using the subtotals (data) can you use muliple functions(sum,max) cooleys Excel Worksheet Functions 1 October 3rd 06 07:16 PM
Convert muliple data into columns Savage Excel Discussion (Misc queries) 8 April 10th 06 05:14 PM
using muliple functions to return one result tauwnia Excel Worksheet Functions 1 January 17th 06 08:45 PM


All times are GMT +1. The time now is 05:52 AM.

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"