+ Reply to Thread
Results 1 to 2 of 2

Thread: using selection/range for transfering tables of data to records for database

  1. #1
    Registered User
    Join Date
    06-22-2011
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    1

    using selection/range for transfering tables of data to records for database

    Hi

    I have some tables of data I want to turn into records to place in a database. There are many tables in sheets (spaces, side by side etc) and they are quite irregular so I am finding it hard to automate.

    I was trying to manually select the area and then run the macro - work across using cells() etc but I am have problems with selection of the range

    I was looking to do something like this but setting the range from selection is causing me all sorts of problems

    for j=2 to range.width
    for i=2 to range.height
    field1=range.cells(1,j)
    field2=range.cells(i,1)
    field3=range.cells(i,j)
    next i
    next j

    Many thanks for your help
    John

  2. #2
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: using selection/range for transfering tables of data to records for database

    Dive into VBA's help files. Look for the lemmas 'currentregion' and 'areas'



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0