LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default ...more repetitive copying

I am sending information from Excel to an Access db. In this series,
I have about 100 columns of information to send. The info is on a
sheet from Range(AN,2) to (EI,2). I am opening the recordset and
updating information. Instead of writing the same line of code 100
times for each cell, is there an easier way to program the column to
go to the next column?? If that makes sense. Below is my code so
far...

as always, everyone on here rocks and thanks for the help in advance.

'open permit.lifecycle recordset
Set rs = New ADODB.Recordset
str = "SELECT * FROM permit_life WHERE permit_num = '" & strPnum &
"'"
rs.Open str, cn, adOpenKeyset, adLockOptimistic ', adCmdTable
' all records in a table
r = 2 ' the start row in the worksheet
' repeat until first empty cell in column A
With rs
.Fields("PLFrm1") = Range("AN" & r).Value
.Fields("PLTo1") = Range("AO & r).Value
' 98 more fields to update up to column EI...
.Update ' stores the new record
End With
'close permit_info recordset and empty memory
rs.Close
Set rs = Nothing
 
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
Repetitive macros rcarolina Excel Discussion (Misc queries) 1 April 7th 10 12:10 AM
Worksheet_Change not repetitive David T. Excel Programming 3 February 18th 08 02:07 AM
looking for repetitive information edluver Excel Programming 3 April 11th 07 04:26 PM
Repetitive keystroke Andre Croteau Excel Discussion (Misc queries) 3 October 7th 06 02:20 AM
repetitive Repetitive formula Excel Discussion (Misc queries) 2 June 28th 06 05:59 AM


All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"