Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Import nonconsecutive rows from excel to access

2 views
Skip to first unread message

Antonio

unread,
May 27, 2010, 5:02:53 PM5/27/10
to
Hello I'm new to this forum and to VBA so pardon me if I did not post this in
the right place.

I need help importing an excel sheet into 3 access tables which are already
created.

I've got the first part going into the first table figured out, but i'm
stuck on the second part which is importing nonconsecutive excel rows into
the 2nd table. These are 12 rows with 14 rows in between each one. The data
in the rown in between will go into my 3rd table. Now i only want to import
these 12 rows if they meet a certain criteria.

Set currentCell = xlSheet.Range("A30")
For x = 0 To 120
[10]

If currentCell.Offset(x, 16) <> 0 Then
With rstCriteria

.AddNew

!TSID = TSID
!PgmNbr = xlSheet.Range("C5")
!EndDateYear = xlSheet.Range("L11")
!CriteriaSeq = currentCell.Offset(x, 0)
!CriteriaType = currentCell.Offset(x, 1)
!CalcBasis = currentCell.Offset(x, 2)
!BaseBegDateYear = currentCell.Offset(x, 3)
!BaseEndDateYear = currentCell.Offset(x, 6)
!CurrBegDateYear = currentCell.Offset(x, 9)
!CurrEndDateYear = currentCell.Offset(x, 12)
!ExclStor = currentCell.Offset(x, 15)
!InitPayment = currentCell.Offset(x, 16)
!TotCalc = currentCell.Offset(x, 17)
!PaymntRate = currentCell.Offset(x, 19)
!PaymntAmnt = currentCell.Offset(x, 20)
!HurdleRate = currentCell.Offset(x, 21)

.Update


End With
End If

Next x

Please point me in the right direction
Much thanks
--
VBA Rookie

0 new messages