나는 여전히 VBA에 익숙하지 않으며 약간의 문제가 있습니다. 데이터 연결 설정이 있고 가져 오기는 테이블에서 모든 데이터를 가져옵니다. 제가 겪고있는 문제는 세 번째 열에 16 자리 숫자가 포함되어 있다는 것입니다. 가져 오기가 발생하면이 열을 텍스트 필드로 가져와야합니다. 그렇지 않으면 가져 오기에서 마지막 숫자를 0으로 대체합니다. 다음은 가져 오기 코드입니다. 어떤 도움이라도 대단히 감사하겠습니다.
Worksheets("Equip Related").Visible = True
Dim WK As Worksheet
Application.ScreenUpdating = False
On Error Resume Next
Application.DisplayAlerts = False
Sheets("Feedback").Delete
On Error GoTo 0
Sheets.Add.Name = "Feedback"
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;WEB ADDRESS HERE", Destination:= _
Range("$A$1"))
.Name = "feedbacklog"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
querytabel의 결과를 resultsobject에 넣고 각 열의 데이터 유형을 설정할 수 있습니다.
Set myResults = ActiveSheet.QueryTables.Add(Connection:= _
"URL;WEB ADDRESS HERE", Destination:= _
Range("$A$1"))
With myResults
.TextFileColumnDataTypes := _
Array(xlGeneralFormat, xlGeneralFormat, xlTextFormat)
.Refresh
End With
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다