Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Extracting info from a database

Private Sub extract()
Dim I As Double
I = 1013
descript = WorksheetFunction.VLookup(I, Range("itemlist!Database"), 2)
Debug.Print descript
descript = WorksheetFunction.VLookup(I, Range("itemlist!Database"), 3)
Debug.Print descript
descript = WorksheetFunction.VLookup(I, Range("itemlist!Database"), 4)
Debug.Print descript
'......etc
End Sub

What I want to do is extract all the information pertaining to "I" ,which
fills 8 columns, with code that will bring it into code as an array.
I know how to send an array to a worksheet but can not find any examples on
how to populate the array from a worksheet.(In this case, my database)

Thanks very much

Dave

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Extracting info from a database

Hi David, try this (Untested):

Private Sub extract()

Dim descript(7) as String
Dim I As Double
I = 1013

descript(0) = WorksheetFunction.VLookup(I, Range("itemlist!Database"), 2)
Debug.Print descript

descript(1) = WorksheetFunction.VLookup(I, Range("itemlist!Database"), 3)
Debug.Print descript

descript(2) = WorksheetFunction.VLookup(I, Range("itemlist!Database"), 4)
Debug.Print descript
'......etc

'to descript(7)
End Sub



Alternatively type "Option Base 1" in the decalrations section of the
module; the Array elements will then be (1) to (8)


--
HTH
Roger
Shaftesbury (UK)



"J David Southwick" wrote in message
...
Private Sub extract()
Dim I As Double
I = 1013
descript = WorksheetFunction.VLookup(I, Range("itemlist!Database"), 2)
Debug.Print descript
descript = WorksheetFunction.VLookup(I, Range("itemlist!Database"), 3)
Debug.Print descript
descript = WorksheetFunction.VLookup(I, Range("itemlist!Database"), 4)
Debug.Print descript
'......etc
End Sub

What I want to do is extract all the information pertaining to "I" ,which
fills 8 columns, with code that will bring it into code as an array.
I know how to send an array to a worksheet but can not find any examples

on
how to populate the array from a worksheet.(In this case, my database)

Thanks very much

Dave



  #3   Report Post  
Posted to microsoft.public.excel.programming
raj raj is offline
external usenet poster
 
Posts: 32
Default Extracting info from a database

J:

Check out this document and see if it helps:

http://www.microsoft.com/exceldev/articles/movs104.htm

NOTE: Once on the above page, search for "Writing data
from the Worksheet"

I found it helpful; hope it helps you too.


-----Original Message-----
Private Sub extract()
Dim I As Double
I = 1013
descript = WorksheetFunction.VLookup(I, Range("itemlist!

Database"), 2)
Debug.Print descript
descript = WorksheetFunction.VLookup(I, Range("itemlist!

Database"), 3)
Debug.Print descript
descript = WorksheetFunction.VLookup(I, Range("itemlist!

Database"), 4)
Debug.Print descript
'......etc
End Sub

What I want to do is extract all the information

pertaining to "I" ,which
fills 8 columns, with code that will bring it into code

as an array.
I know how to send an array to a worksheet but can not

find any examples on
how to populate the array from a worksheet.(In this case,

my database)

Thanks very much

Dave

.

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
Link info in one cell to info in several cells in another column (like a database) hansdiddy Excel Discussion (Misc queries) 1 February 22nd 06 02:27 AM
Extracting Records From Excel Database thorvision Excel Discussion (Misc queries) 5 December 1st 05 06:09 AM
Extracting data without using database functions MelbTim Excel Worksheet Functions 5 May 30th 05 06:20 AM
extracting contact info to a database gordie Excel Discussion (Misc queries) 1 January 15th 05 02:50 PM
extracting info the best way shiepowk Excel Programming 1 November 5th 03 11:26 AM


All times are GMT +1. The time now is 11:05 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"