Please help with excel

mosteanuv

New Member
Joined
Sep 9, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hey there guys, I would really like some help because i don't even know how to search for this online.

I would like for the excel to add automatically in the last sheet called "Elevi" in the table called "Cristian Tanase" under "Elev" if he detects "Cristian Tanase" selected from drop down menu in sheets "01" to "31" under the table called "Grupe" under "Elev" and the values that are after it for "Numerar" and "Cash"


So to better understand we write the daily reports on how much kids paid for each coach and I would like the last sheet to extract the names and sums for each coach to have a monthly report.

Thank you very much
 

Attachments

  • xcl1.png
    xcl1.png
    48.4 KB · Views: 11
  • xcl2.png
    xcl2.png
    32.1 KB · Views: 11

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Figured out how to make a module in VBA:

VBA Code:
Sub CopyOverBudgetRecords()

    Dim StatusCol As Range
    Dim Status As Range
    Dim PasteCell As Range
    Dim ws As Worksheet
    Dim wsDestination As Worksheet
    Dim wsName As Variant
   
    ' Set destination worksheet (Sheet36 in this case)
    Set wsDestination = ThisWorkbook.Sheets("Elevi")

    ' Loop through the sheets
    For Each wsName In Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31")
        On Error Resume Next ' Bypass any error
        Set ws = ThisWorkbook.Sheets(wsName)
        On Error GoTo 0 ' Re-enable error checking

        If Not ws Is Nothing Then
            ' Set the range in Column B where your criteria will be checked
            Set StatusCol = ws.Range("B5:B25")
           
            For Each Status In StatusCol
               
                ' Check if the destination sheet has empty space in column B for pasting
                If wsDestination.Range("B6") = "" Then
                    Set PasteCell = wsDestination.Range("B6")
                Else
                    ' Find the next available row in column B
                    Set PasteCell = wsDestination.Cells(wsDestination.Rows.Count, "B").End(xlUp).Offset(1, 0)
                End If
               
                ' Copy values from Columns C, D, E if criteria in Column B is met
                If Status = "Cristian Tanase" Then
                    ' Copy only the values from Columns C, D, E (3 columns to the right of Column B)
                    Status.Offset(0, 1).Resize(1, 3).Copy
                    PasteCell.PasteSpecial Paste:=xlPasteValues
                End If

            Next Status
        End If
    Next wsName

    ' Clear the clipboard to avoid Excel pop-up message
    Application.CutCopyMode = False

End Sub
 
Last edited by a moderator:
Upvote 0
Solution

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top