- Ha az alaplapi hangchipnél jobbra váltanál, itt az új Sound Blaster hangkártya
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- Projektor topic
- Apple MacBook
- Fejhallgató erősítő és DAC topik
- Egyre csábítóbbak ezek az ASUS ExpertCenter mini PC-k
- Milyen monitort vegyek?
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Gaming notebook topik
- Androidos tablet topic
-
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
-
p5quser
tag
válasz
Fferi50
#37652
üzenetére
Üdv!
Nem teljesen világos, hová kéne beszúrnom a copy parancsot. Ahová raktam, ott range copy metódus hibával elszállt.
Most így néz ki a script jelenleg, de így "előjeltelen"
Private Sub CommandButton1_Click()
Dim xFso As Object
Dim xFld As Object
Dim xStrSearch As String
Dim xStrPath As String
Dim xStrFile As String
Dim xOut As Worksheet
Dim xWb As Workbook
Dim xWk As Worksheet
Dim xRow As Long
Dim xFound As Range
Dim xStrAddress As String
Dim xFileDialog As FileDialog
Dim xUpdate As Boolean
Dim xCount As Long
On Error GoTo ErrHandler
Set xFileDialog = Application.FileDialog(msoFileDialogFolderPicker)
xFileDialog.AllowMultiSelect = False
xFileDialog.Title = "Select a forlder"
If xFileDialog.Show = -1 Then
xStrPath = xFileDialog.SelectedItems(1)
End If
If xStrPath = "" Then Exit Sub
xStrSearch = "elszámol"
xUpdate = Application.ScreenUpdating
Application.ScreenUpdating = False
Set xOut = Worksheets.Add
xRow = 1
With xOut
.Cells(xRow, 1) = "Munkafüzet"
.Cells(xRow, 2) = "Munkalap"
.Cells(xRow, 3) = "Cella"
.Cells(xRow, 4) = "Találat"
.Cells(xRow, 5) = "Név"
.Cells(xRow, 6) = "Összeg"
Set xFso = CreateObject("Scripting.FileSystemObject")
Set xFld = xFso.GetFolder(xStrPath)
xStrFile = Dir(xStrPath & "\*.xls*")
Do While xStrFile <> ""
Set xWb = Workbooks.Open(Filename:=xStrPath & "\" & xStrFile, UpdateLinks:=0, ReadOnly:=True, AddToMRU:=False)
For Each xWk In xWb.Worksheets
Set xFound = xWk.UsedRange.Find(xStrSearch)
Set xFn = xWk.UsedRange.Find(xStrSearch)
If Not xFound Is Nothing Then
xStrAddress = xFound.Address
xNev = xFound.Offset(0, -1).Value
xOssz = xFound.Offset(0, 1).Value
End If
Do
If xFound Is Nothing Then
Exit Do
Else
xCount = xCount + 1
xRow = xRow + 1
.Cells(xRow, 1) = xWb.Name
.Cells(xRow, 2) = xWk.Name
.Cells(xRow, 3) = xFound.Address
.Cells(xRow, 4) = xFound.Value
.Cells(xRow, 5) = xNev
.Cells(xRow, 6) = xOssz
End If
Set xFound = xWk.Cells.FindNext(After:=xFound)
Loop While xStrAddress <> xFound.Address
Next
xWb.Close (False)
xStrFile = Dir
Loop
.Columns("A:F").EntireColumn.AutoFit
End With
MsgBox xCount & " egyezést találtam", , "Elszámolósdi"
ExitHandler:
Set xOut = Nothing
Set xWk = Nothing
Set xWb = Nothing
Set xFld = Nothing
Set xFso = Nothing
Application.ScreenUpdating = xUpdate
Exit Sub
ErrHandler:
MsgBox Err.Description, vbExclamation
Resume ExitHandler
End SubKöszönöm!

Új hozzászólás Aktív témák
- Ha az alaplapi hangchipnél jobbra váltanál, itt az új Sound Blaster hangkártya
- Audi, Cupra, Seat, Skoda, Volkswagen topik
- Diablo IV
- eBay-es kütyük kis pénzért
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- Projektor topic
- Linux felhasználók OFF topikja
- Óra topik
- Apple MacBook
- Fejhallgató erősítő és DAC topik
- További aktív témák...
- Game Pass Ultimate előfizetések 1 - 36 hónapig azonnali kézbesítéssel a LEGOLCSÓBBAN! AKCIÓ!
- Windows, Office licencek kedvező áron, egyenesen a Microsoft-tól - Automata kézbesítés utalással is!
- Windows 10/11 Home/Pro , Office 2024 kulcsok
- Xbox / Microsoft Store feltöltőkártya kód (digitális, HU) több címlet, több db, azonnal, olcsón
- Bitdefender Total Security 3év/3eszköz! - Tökéletes védelem.
- Apple iPhone 11 Pro 64GB, Kártyafüggetlen, 1 Év Garanciával
- 27% - Intel xeon E5 2630 / RX550 / 16GB / 512GB / 500W Konfiguráció
- LicencAruhaz.hu OLCSÓ, LEGÁLIS SZOFTVEREK AZONNAL - Windows - Office - Win Server - ÖRÖK GARANCIÁVAL
- iPhone 15 Pro Max 512GB 87% Esim-es verzió (3hónap Garancia) Kijelzőn pici folt!
- Kihagyhatatlan ajánlat! Lenovo ThinkPad P14s Gen 5 Ultra 7 165H (vPro) 32gb DDR5 ram RTX500 ADA 3K
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest




