-
Fototrend
A Microsoft Excel topic célja segítséget kérni és nyújtani Excellel kapcsolatos problémákra.
Kérdés felvetése előtt olvasd el, ha még nem tetted.
Új hozzászólás Aktív témák
-
Kraptor
őstag
válasz
hbbalint
#101
üzenetére
Úgy simán sehogy, mert 65K a limit, de vannak okosságok amivel meglehet kerülni ezeket. Van egy progi amit Microsoft Office Spreadsheet 10.0 UserForm control-nak hívnak és ezzel elvileg létretudsz hozni 18,278 x 262,144-es lapokat.Ezt nem tudom, hogy mennyire igaz vagy nem.
Vagy vannak különböző makrók amikkel megtudsz nyitnyi nagyobb fileokat, csak akkor több lapba fogja megnyitni őket automatikusan.
Sub ImportLargeFile()
'Imports text file into Excel workbook using ADO.
'If the number of records exceeds 65536 then it splits it over more than one sheet.
Dim strFilePath As String, strFilename As String, strFullPath As String
Dim lngCounter As Long
Dim oConn As Object, oRS As Object, oFSObj As Object
'Get a text file name
strFullPath = Application.GetOpenFilename(''Text Files (*.txt),*.txt'', , ''Please select text file...'')
If strFullPath = ''False'' Then Exit Sub 'User pressed Cancel on the open file dialog
Application.ScreenUpdating = False
'This gives us a full path name e.g. C:\folder\file.txt
'We need to split this into path and file name
Set oFSObj = CreateObject(''SCRIPTING.FILESYSTEMOBJECT'')
strFilePath = oFSObj.GetFile(strFullPath).ParentFolder.Path
strFilename = oFSObj.GetFile(strFullPath).Name
'Open an ADO connection to the folder specified
Set oConn = CreateObject(''ADODB.CONNECTION'')
oConn.Open ''Provider=Microsoft.Jet.OLEDB.4.0;'' & _
''Data Source='' & strFilePath & '';'' & _
''Extended Properties=''''text;HDR=Yes;FMT=Delimited''''''
Set oRS = CreateObject(''ADODB.RECORDSET'')
'Now actually open the text file and import into Excel
oRS.Open ''SELECT * FROM '' & strFilename, oConn, 3, 1, 1
While Not oRS.EOF
Sheets.Add
ActiveSheet.Range(''A1'').CopyFromRecordset oRS, 65536
Wend
oRS.Close
oConn.Close
Application.ScreenUpdating = True
End Sub
Itt egy másik is:
Sub LoadData()
Const cCol1 = 20, cCol2 = 20, cCol3 = 20, cLimit = 50000
Dim intFreeFile As Integer, i As Long, j As Long, strTemp As String
Dim arr() As String
On Error Resume Next
intFreeFile = FreeFile
Open ''c:\test.txt'' For Input As #intFreeFile
i = 0: j = 1
ReDim arr(cLimit, 2)
Do Until EOF(intFreeFile)
Line Input #intFreeFile, strTemp
arr(i, 0) = Trim(Mid(strTemp, 1, cCol1))
arr(i, 1) = Trim(Mid(strTemp, cCol1, cCol2))
arr(i, 2) = Trim(Mid(strTemp, cCol1 + cCol2, cCol3))
i = i + 1
If i > cLimit - 1 Then
Cells(1, j).Resize(cLimit, 3).Value = arr
i = 0: j = j + 3
ReDim arr(cLimit, 2)
End If
Loop
Close #intFreeFile
End Sub
Új hozzászólás Aktív témák
- Újra nekifeszül az asztali konzolok piacának a Valve
- GoodSpeed: 3I/Atlas: Üstökös vagy idegen civilizáció űrhajója?
- Álláskeresés, interjú, önéletrajz
- Otthoni hálózat és internet megosztás
- Xbox Series X|S
- VR topik (Oculus Rift, stb.)
- Fejhallgató erősítő és DAC topik
- Soundbar, soundplate, hangprojektor
- OTP Bank topic
- Xbox tulajok OFF topicja
- További aktív témák...
- Logitech z5500 5.1
- Eredeti, új Lenovo 330W töltők - ADL330SDC3A
- Bomba ár! HP EliteBook 820 G2 - i5-5GEN I 8GB I 256GB SSD I 12,5" FHD I Cam I W10 I Garancia!
- GYÖNYÖRŰ iPhone 13 Pro 128GB Graphite -1 ÉV GARANCIA - Kártyafüggetlen, MS3962, 100% Akkumulátor
- Telefon felvásárlás!! Xiaomi Redmi 9, Xiaomi Redmi 9AT, Xiaomi Redmi 10, Xiaomi Redmi 10 2022
Állásajánlatok
Cég: NetGo.hu Kft.
Város: Gödöllő
Cég: Laptopműhely Bt.
Város: Budapest
Fferi50
