- One mobilszolgáltatások
- Samsung Galaxy Watch8 - Classic - Ultra 2025
- Android szakmai topik
- Mától Huawei okosórákkal is lehet érintésmentesen fizetni
- Google Pixel topik
- Xiaomi 15T Pro - a téma nincs lezárva
- Honor Magic6 Pro - kör közepén számok
- Milyen okostelefont vegyek?
- iPhone topik
- Huawei Watch GT 6 és GT 6 Pro duplateszt
-
Mobilarena
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
Sziasztok!
Ismét a segítségeteket kérném. Adott egy munkafüzet, a hónap napjaira bontott munkalapokkal. Ebben a munkafüzetben kellene rákeresnem az "elszámolás" szóra minden munkalapon, kilistáztatva a napot, az elszámolás szót, egy oszloppal a találat előtti értéket és egy oszloppal a találat utáni értéket.
Alább a script amit találtam, teszi a dolgát, csak nem tudom hogy irassam ki vele az eltolt oszlopok értékeit.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) = "Workbook"
.Cells(xRow, 2) = "Worksheet"
.Cells(xRow, 3) = "Cella"
.Cells(xRow, 4) = "Találat"
.Cells(xRow, 5) = "Összeg"
.Cells(xRow, 6) = "Név"
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)
If Not xFound Is Nothing Then
xStrAddress = xFound.Address
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) = xFound.Value
.Cells(xRow, 6) = xFound.Value
End If
Set xFound = xWk.Cells.FindNext(After:=xFound)
Loop While xStrAddress <> xFound.Address
Next
xWb.Close (False)
xStrFile = Dir
Loop
.Columns("A:D").EntireColumn.AutoFit
End With
MsgBox xCount & " egyezést találtam", , "Elszámolós"
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 SubEzeket szeretném megváltoztatni;
.Cells(xRow, 5) = xFound.Value (találat_oszlop -1, találat_sor)
.Cells(xRow, 6) = xFound.Value (találat_oszlop +1, találat_sor)
Előre is köszönöm!
Új hozzászólás Aktív témák
- Milyen billentyűzetet vegyek?
- BestBuy topik
- Melyik tápegységet vegyem?
- TCL LCD és LED TV-k
- Tesla topik
- One mobilszolgáltatások
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- AMD Ryzen 9 / 7 / 5 / 3 5***(X) "Zen 3" (AM4)
- Milyen Android TV boxot vegyek?
- Star Trek Online -=MMORPG=-
- További aktív témák...
- Játékkulcsok olcsón: Steam, Uplay, GoG, Origin, Xbox, PS stb.
- The Elder Scrolls Online Imperial Collector s Edition
- Kaspersky, BitDefender, Avast és egyéb vírusírtó licencek a legolcsóbban, egyenesen a gyártóktól!
- Windows 10 11 Pro Office 19 21 Pro Plus Retail kulcs 1 PC Mac AKCIÓ! Automatikus 0-24
- Windows 10 11 Pro Office 19 21 Pro Plus Retail kulcs 1 PC Mac AKCIÓ! Automatikus 0-24
- HIBÁTLAN iPhone SE 2020 64GB Black-1 ÉV GARANCIA - Kártyafüggetlen, MS4001
- Kuriózum: Ozark Trail (amerikai) fejlámpa 600 lumen
- Lenovo Thinkpad E495 Ryzen 5 3500U, Radeon Vega 8, 8-16GB RAM, SSD, jó akku, számla, gar
- 27% - Corsair Nautilus 240 RS RGB White Vízhűtő!
- Gravity MS állvány + RØDE XDM-100 Mikrofon!
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Fferi50
