-
PROHARDVER!
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
- Lexus, Toyota topik
- alza vélemények - tapasztalatok
- Samsung Galaxy Buds3 Pro - szárat eresztettek a babok
- Semmibe veszi a KRESZ-t a Tesla Mad Max módja
- One otthoni szolgáltatások (TV, internet, telefon)
- Otthoni hálózat és internet megosztás
- World of Warships
- Kuponkunyeráló
- ROG Xbox Ally X: Összefogás
- Suzuki topik
- További aktív témák...
- HIBÁTLAN iPhone 13 mini 128GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS3337, 94% Akkumulátor
- AKCIÓ! HP Victus Gaming 16-S0017NH 16 notebook - R5 7640HS 32GB DDR5 1TB SSD RTX 4050 6GB WIN1
- HIBÁTLAN iPhone 14 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3237
- Xbox Game Pass Ultimate előfizetések kedvező áron
- AKCIÓ! Apple Studio Display 27 5K Nanotexturált üveg monitor garanciával hibátlan működéssel
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: NetGo.hu Kft.
Város: Gödöllő