Selection or Recordset to Array

  • Thread starter Thread starter Witek
  • Start date Start date
W

Witek

Hello:)
I take data with two ways.
1. From acces, sql with select string
2. From Sheet in Excel

Is any idea to put data from "Selection" to Array?
Like this:
varArray()=selection
or
varArray()=newRS ' active recordset
I made now loop:
For or Do While through
- all records in recordset
- all rows in demension (selection), row by row, field by field.


Tx for any advice:)
 
read Help

dim arr as Variant
arr = Selection

DIM rs as Recordset

' populate from database


Range("B2").Resize(rs.RecordCount, rs.Fields.Count).CopyFromRecordset
rs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top