내가 정확한 방향을 가리 키도록하겠습니다, 내가 너를 올바르게 이해한다고 가정 할 때.
당신이 열고 Excel 스프레드 시트에서 읽을하고자하는 경우
이 유용 할 것입니다 :
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim cmd As ADODB.Command
'Set up the Connection to Excel
Set cnn = New ADODB.Connection
With cnn
.Provider = "Microsoft.ACE.OLEDB.12.0" 'or whatever your provider is
.ConnectionString = "Data Source="C:\My_source_file.xlsx';Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1';"
.Open
End With
'Set up the command to get all that mess out the spreadsheet.
Set cmd = New ADODB.Command
With cmd
.ActiveConnection = cnn
.CommandText = "SELECT * FROM [WhateverSheetHasMyData$]"
End With
'Load up the recordset with everything in the worksheet.
Set rst = New ADODB.Recordset
With rst
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmd
End With
이것은 당신이 당신이 가고 싶은 방향으로 가야한다. 다른 스프레드 시트 또는 데이터베이스 테이블과 같은 다른 문서에로드 한 데이터를 입금하는 명령을 사용하는 방법을이 방법에서 추정 할 수 있습니다.
...
Dim ws As Excel.Worksheet
Dim lastrow As Integer
Set ws = wb.Sheets(1) 'wb being your workbook object; you could also use the sheet name instead of the index here
ws.Activate
lastrow = ws.Cells.SpecialCells(11).Row 'gets you the last row
그래서, 당신은 당신의 삽입을위한 출발점으로 그 lastrow + 1 개 값을 사용할 수 있습니다 : 그것은 정보를 추가로 제공 할 때
또한, Excel은 멋진 일이있다. 여담으로
,
는 "도움말 및 팁 대단히 감사합니다! Plz은 올바른 방향으로 나를 가리 키도록 귀찮게하지 않습니다 ..."
^일반적으로 안 좋은 일을 to say이 부분들. 특히 당신이 "당신의 도움에 감사하지만 제발 나를 도와주지 마세요"라고했을 때.
재미있게 보내십시오.