-
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
- Kaspersky, BitDefender, Avast és egyéb vírusírtó licencek a legolcsóbban, egyenesen a gyártóktól!
- Kaspersky, BitDefender, Avast és egyéb vírusírtó licencek a legolcsóbban, egyenesen a gyártóktól!
- Windows 10/11 Home/Pro , Office 2024 kulcsok
- Eredeti Microsoft termékek - MEGA Akciók! Windows, Office Pro Plus, Project Pro, Visio Pro stb.
- Játékkulcsok ! : PC Steam, EA App, Ubisoft, Windows és egyéb játékok
- Apple iPhone 17 256GB Sage használt újszerű 100% akku 32 ciklus Apple garancia 2027.01.06-ig
- LG 40U990A-W / 40" Ívelt Nano IPS Black / 5K UHD 120Hz / 2x ThunderBolt 5.0 / Adobe RGB 99%
- Akciós Windows 10 pro + Office 2019 professional plus csomag AZONNALI SZÁLLÍTÁS
- Telefon felváráslás!! iPhone 15/iPhone 15 Plus/iPhone 15 Pro/iPhone 15 Pro Max
- DELL Optiplex 3060 SFF - i5-8500 / 8GB / 256GB SSD / DVD / Win11
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs
Fferi50
