Userform to search and update rows with multiple matches

mhaidar81

New Member
Joined
Dec 9, 2017
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I have a userform with a search box that looks for a match in Sheet1 Column A. If a match is found, certain cells from the matched row are displayed in the userform in textboxes. I am able to modify these textboxes and write the changes back to the cells they came from.

The issue that I am running into is when I have multiple matches. When I click the Search button again, I am able to see the cells from the second match displayed in the textboxes. However, when I modify them, the changes are applied to the first match. How can I modify the textboxes and apply the changes to the correct match? This is my code. Also, is there a way to shorten this code? I really appreciate any help
VBA Code:
Private Sub cmdUpdate_Click()

    Dim wsTimesheet, wsMasterPay, wsEmployeeInformation As Worksheet
    
    Set wsTimesheet = Worksheets("Timesheet")
    Set wsMasterPay = Worksheets("Master Pay")
    Set wsEmployeeInformation = Worksheets("Employee Information")
    
    Dim lastRow, i As Long
    Dim searchText As String
    Dim results15(1 To 16), resultsEnd(1 To 12), resultsCalc(1 To 7) As Variant
    
    lastRow = wsTimesheet.Cells(wsTimesheet.Rows.Count, "A").End(xlUp).Row ' Get the last row of column A
    
    searchText = Me.txtSearch.Value
      
    For i = 2 To lastRow ' Loop through each row in column A, starting from row 2
    
    If wsTimesheet.Cells(i, 1).Value = searchText Then ' Check if the value in column A matches the search text
    'Get updated values from textboxes
    
            results15(1) = Me.Pending.Value
            results15(2) = Me.Adjustment.Value
            results15(3) = Me.AdjustmentDays.Value
            results15(4) = Me.NewOldSalary.Value
            results15(5) = Me.Reg1.Value
            results15(6) = Me.OT1.Value
            results15(7) = Me.WHOT1.Value
            results15(8) = Me.WH1.Value
            results15(9) = Me.PO1.Value
            results15(10) = Me.RR1.Value
            results15(11) = Me.SL1.Value
            results15(12) = Me.NWH1.Value
            results15(13) = Me.BER1.Value
            results15(14) = Me.WED1.Value
            results15(15) = Me.AWOL1.Value
            results15(16) = Me.LWOP1.Value
            resultsEnd(1) = Me.Reg2.Value
            resultsEnd(2) = Me.OT2.Value
            resultsEnd(3) = Me.WHOT2.Value
            resultsEnd(4) = Me.WH2.Value
            resultsEnd(5) = Me.PO2.Value
            resultsEnd(6) = Me.RR2.Value
            resultsEnd(7) = Me.SL2.Value
            resultsEnd(8) = Me.NWH2.Value
            resultsEnd(9) = Me.BER2.Value
            resultsEnd(10) = Me.WED2.Value
            resultsEnd(11) = Me.AWOL2.Value
            resultsEnd(12) = Me.LWOP2.Value
            resultsCalc(1) = Me.Gross.Value
            resultsCalc(2) = Me.SS.Value
            resultsCalc(3) = Me.PIT.Value
            resultsCalc(4) = Me.PCV.Value
            resultsCalc(5) = Me.AddDeduct.Value
            resultsCalc(6) = Me.COLA.Value
            resultsCalc(7) = Me.NetIncome.Value
            updateComments = Me.Comments.Value
                      
            ' Update the corresponding cells in Excel using an array
            wsTimesheet.Cells(i, 3).Resize(1, 16).Value = results15
            wsTimesheet.Cells(i, 20).Resize(1, 12).Value = resultsEnd
            wsTimesheet.Cells(i, 46).Resize(1, 7).Value = resultsCalc
            wsTimesheet.Cells(i, 35).Value = updateComments
    
            ' Display a message box to confirm that the update was successful
            MsgBox "Update successful.", vbOKOnly + vbInformation, "Update Results"
            Exit Sub ' Exit the loop after the first match is found
        End If
    Next i
        
End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi,
Having found the required record, you should not need to repeat the search action in your Update code.
You can store the record row number in a module level variable & use this to post the record back to your database
Module level variables are placed at the very TOP of your userform code page OUTSIDE any procedure & will hold their value while the userform is loaded.

example

VBA Code:
  Dim RecordRow  As Long
 Dim wsTimesheet As Worksheet, wsMasterPay As Worksheet, wsEmployeeInformation As Worksheet

Private Sub cmdUpdate_Click()

            results15(1) = Me.Pending.Value
            results15(2) = Me.Adjustment.Value
            results15(3) = Me.AdjustmentDays.Value
            results15(4) = Me.NewOldSalary.Value
            results15(5) = Me.Reg1.Value
            results15(6) = Me.OT1.Value
            results15(7) = Me.WHOT1.Value
            results15(8) = Me.WH1.Value
            results15(9) = Me.PO1.Value
            results15(10) = Me.RR1.Value
            results15(11) = Me.SL1.Value
            results15(12) = Me.NWH1.Value
            results15(13) = Me.BER1.Value
            results15(14) = Me.WED1.Value
            results15(15) = Me.AWOL1.Value
            results15(16) = Me.LWOP1.Value
            resultsEnd(1) = Me.Reg2.Value
            resultsEnd(2) = Me.OT2.Value
            resultsEnd(3) = Me.WHOT2.Value
            resultsEnd(4) = Me.WH2.Value
            resultsEnd(5) = Me.PO2.Value
            resultsEnd(6) = Me.RR2.Value
            resultsEnd(7) = Me.SL2.Value
            resultsEnd(8) = Me.NWH2.Value
            resultsEnd(9) = Me.BER2.Value
            resultsEnd(10) = Me.WED2.Value
            resultsEnd(11) = Me.AWOL2.Value
            resultsEnd(12) = Me.LWOP2.Value
            resultsCalc(1) = Me.Gross.Value
            resultsCalc(2) = Me.SS.Value
            resultsCalc(3) = Me.PIT.Value
            resultsCalc(4) = Me.PCV.Value
            resultsCalc(5) = Me.AddDeduct.Value
            resultsCalc(6) = Me.COLA.Value
            resultsCalc(7) = Me.NetIncome.Value
            updateComments = Me.Comments.Value
                    
            ' Update the corresponding cells in Excel using an array
            wsTimesheet.Cells(RecordRow, 3).Resize(1, 16).Value = results15
            wsTimesheet.Cells(RecordRow, 20).Resize(1, 12).Value = resultsEnd
            wsTimesheet.Cells(RecordRow, 46).Resize(1, 7).Value = resultsCalc
            wsTimesheet.Cells(RecordRow, 35).Value = updateComments
  
            ' Display a message box to confirm that the update was successful
            MsgBox "Update successful.", vbOKOnly + vbInformation, "Update Results"
        
      
End Sub

Private Sub UserForm_Initialize()
    Set wsTimesheet = Worksheets("Timesheet")
    Set wsMasterPay = Worksheets("Master Pay")
    Set wsEmployeeInformation = Worksheets("Employee Information")
End Sub

In your search code, you would initialize the variable RecordRow with the found records row which is used by the Update code.

You can also consider placing variables that you may have repeated in other userform codes at module level for instance, the worksheet object variables I have shown.

Hope Helpful

Dave
 
Last edited:
Upvote 0
Hi,
Having found the required record, you should not need to repeat the search action in your Update code.
You can store the record row number in a module level variable & use this to post the record back to your database
Module level variables are placed at the very TOP of your userform code page OUTSIDE any procedure & will hold their value while the userform is loaded.

example

VBA Code:
  Dim RecordRow  As Long
 Dim wsTimesheet As Worksheet, wsMasterPay As Worksheet, wsEmployeeInformation As Worksheet

Private Sub cmdUpdate_Click()

            results15(1) = Me.Pending.Value
            results15(2) = Me.Adjustment.Value
            results15(3) = Me.AdjustmentDays.Value
            results15(4) = Me.NewOldSalary.Value
            results15(5) = Me.Reg1.Value
            results15(6) = Me.OT1.Value
            results15(7) = Me.WHOT1.Value
            results15(8) = Me.WH1.Value
            results15(9) = Me.PO1.Value
            results15(10) = Me.RR1.Value
            results15(11) = Me.SL1.Value
            results15(12) = Me.NWH1.Value
            results15(13) = Me.BER1.Value
            results15(14) = Me.WED1.Value
            results15(15) = Me.AWOL1.Value
            results15(16) = Me.LWOP1.Value
            resultsEnd(1) = Me.Reg2.Value
            resultsEnd(2) = Me.OT2.Value
            resultsEnd(3) = Me.WHOT2.Value
            resultsEnd(4) = Me.WH2.Value
            resultsEnd(5) = Me.PO2.Value
            resultsEnd(6) = Me.RR2.Value
            resultsEnd(7) = Me.SL2.Value
            resultsEnd(8) = Me.NWH2.Value
            resultsEnd(9) = Me.BER2.Value
            resultsEnd(10) = Me.WED2.Value
            resultsEnd(11) = Me.AWOL2.Value
            resultsEnd(12) = Me.LWOP2.Value
            resultsCalc(1) = Me.Gross.Value
            resultsCalc(2) = Me.SS.Value
            resultsCalc(3) = Me.PIT.Value
            resultsCalc(4) = Me.PCV.Value
            resultsCalc(5) = Me.AddDeduct.Value
            resultsCalc(6) = Me.COLA.Value
            resultsCalc(7) = Me.NetIncome.Value
            updateComments = Me.Comments.Value
                   
            ' Update the corresponding cells in Excel using an array
            wsTimesheet.Cells(RecordRow, 3).Resize(1, 16).Value = results15
            wsTimesheet.Cells(RecordRow, 20).Resize(1, 12).Value = resultsEnd
            wsTimesheet.Cells(RecordRow, 46).Resize(1, 7).Value = resultsCalc
            wsTimesheet.Cells(RecordRow, 35).Value = updateComments
 
            ' Display a message box to confirm that the update was successful
            MsgBox "Update successful.", vbOKOnly + vbInformation, "Update Results"
       
     
End Sub

Private Sub UserForm_Initialize()
    Set wsTimesheet = Worksheets("Timesheet")
    Set wsMasterPay = Worksheets("Master Pay")
    Set wsEmployeeInformation = Worksheets("Employee Information")
End Sub

In your search code, you would initialize the variable RecordRow with the found records row which is used by the Update code.

You can also consider placing variables that you may have repeated in other userform codes at module level for instance, the worksheet object variables I have shown.

Hope Helpful

Dave
Thanks for your reply and for your recommendations about placing variables globally. Each row represents a different type of timesheet for an employee. For example, I can have an employee with a Regular Timesheet (on one row) and a Correction timesheet (on another). That's why I would need to repeat the search and update all matching records.
 
Upvote 0
Without seeing your project difficult to comment further
Suggest if possible, place copy of your workbook with dummy data on a file sharing site like dropbox & provide a link to it.

Dave
 
Upvote 0
Thanks, Dave. Here are links to the macro and file.

I made some changes to keep track of the number of rows, but now the updating a record will update all rows with the same ID. I think it has to do with my array being 1-dimentional?


Thanks and I appreciate your help.
 
Upvote 0
Hi,

I have had a short play with your project & based on the limited sample data workbook you provided, made an attempt to update your code.

I have assumed that the File workbook provided resides within the Macro workbook i.e. you have just the one workbook?

In normal scheme of things, I would take a different approach coding the userform but due to time limitations, I have sort of stuck with your approach but I have attempted to remove most of the code redundancy (doing the same thing in multiple places) you had



1 – Make a backup of your workbook

2 – Delete ALL existing code in your UserForm code page

3 – Copy & paste to your userform code page all code below




Code:
Option Explicit
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                               MODULE LEVEL VARIABLES
'                                   These variables MUST be at the TOP of the userforms code page OUTSIDE any procedure
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dim ResultRow           As Long, RecordRow As Long
Dim MatchCount         As Long, resultCount As Long
Dim searchValue         As String
Dim wsTimesheet        As Worksheet, wsMasterPay As Worksheet, wsEmployeeInformation As Worksheet

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                                               TEXTBOXES
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub txtSearch_Change()
    searchValue = Me.txtSearch.Value
    'count matches in range
    If Len(searchValue) > 0 Then MatchCount = Application.CountIf(wsTimesheet.Columns(1), searchValue)
    'enable buttons
     With Me.cmdUpdate
        .Enabled = MatchCount > 0
        Me.InsertRow.Enabled = .Enabled
     End With
     'get record
    Call cmdSearch_Click
    GetEmployeeData
End Sub

Private Sub Salary_Change()
    Salary = Format(Salary, "$#,###.00")
End Sub

Private Sub Project_Change()
    'Disable txtAnotherTextBox if txtResultC contains "ABC"
    If InStr(1, Me.Project.Value, ".02.03", vbTextCompare) > 0 Then
        OT1.Enabled = False
        OT2.Enabled = False
        WHOT1.Enabled = False
        WHOT2.Enabled = False
    Else
        OT1.Enabled = True
        OT2.Enabled = True
        WHOT1.Enabled = True
        WHOT2.Enabled = True
    End If
End Sub
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                                      COMMANDBUTTONS
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub cmdSearch_Click()
    Dim rw                  As Long
    Dim FoundMatch  As Boolean
   
    If ResultRow > 0 And resultCount < MatchCount Then
        rw = ResultRow + 1
    Else
        rw = 1
        resultCount = 0
    End If
   
    With wsTimesheet
        Do While rw <= .Cells(Rows.Count, "A").End(xlUp).Row
            FoundMatch = .Cells(rw, 1).Value = searchValue
           
            'Display matching results in textboxes
            Me.Pending.Value = IIf(FoundMatch, .Cells(rw, 3).Value, "")
            Me.Adjustment.Value = IIf(FoundMatch, .Cells(rw, 4).Value, "")
            Me.AdjustmentDays.Value = IIf(FoundMatch, .Cells(rw, 5).Value, "")
            Me.NewOldSalary.Value = IIf(FoundMatch, .Cells(rw, 6).Value, "")
            Me.Reg1.Value = IIf(FoundMatch, .Cells(rw, 7).Value, "")
            Me.OT1.Value = IIf(FoundMatch, .Cells(rw, 8).Value, "")
            Me.WHOT1.Value = IIf(FoundMatch, .Cells(rw, 9).Value, "")
            Me.WH1.Value = IIf(FoundMatch, .Cells(rw, 10).Value, "")
            Me.PO1.Value = IIf(FoundMatch, .Cells(rw, 11).Value, "")
            Me.RR1.Value = IIf(FoundMatch, .Cells(rw, 12).Value, "")
            Me.SL1.Value = IIf(FoundMatch, .Cells(rw, 13).Value, "")
            Me.NWH1.Value = IIf(FoundMatch, .Cells(rw, 14).Value, "")
            Me.BER1.Value = IIf(FoundMatch, .Cells(rw, 15).Value, "")
            Me.WED1.Value = IIf(FoundMatch, .Cells(rw, 16).Value, "")
            Me.AWOL1.Value = IIf(FoundMatch, .Cells(rw, 17).Value, "")
            Me.LWOP1.Value = IIf(FoundMatch, .Cells(rw, 18).Value, "")
           
            Me.Reg2.Value = IIf(FoundMatch, .Cells(rw, 20).Value, "")
            Me.OT2.Value = IIf(FoundMatch, .Cells(rw, 21).Value, "")
            Me.WHOT2.Value = IIf(FoundMatch, .Cells(rw, 22).Value, "")
            Me.WH2.Value = IIf(FoundMatch, .Cells(rw, 23).Value, "")
            Me.PO2.Value = IIf(FoundMatch, .Cells(rw, 24).Value, "")
            Me.RR2.Value = IIf(FoundMatch, .Cells(rw, 25).Value, "")
            Me.SL2.Value = IIf(FoundMatch, .Cells(rw, 26).Value, "")
            Me.NWH2.Value = IIf(FoundMatch, .Cells(rw, 27).Value, "")
            Me.BER2.Value = IIf(FoundMatch, .Cells(rw, 28).Value, "")
            Me.WED2.Value = IIf(FoundMatch, .Cells(rw, 29).Value, "")
            Me.AWOL2.Value = IIf(FoundMatch, .Cells(rw, 30).Value, "")
            Me.LWOP2.Value = IIf(FoundMatch, .Cells(rw, 31).Value, "")
            Me.DaysWorked.Value = IIf(FoundMatch, .Cells(rw, 33).Value, "")
           
            Me.Comments = IIf(FoundMatch, .Cells(rw, 35).Value, "")
           
            Me.TotalAWOL.Value = IIf(FoundMatch, .Cells(rw, 17).Value + .Cells(rw, 30).Value, "")
            Me.TotalLWOP.Value = IIf(FoundMatch, .Cells(rw, 18).Value + .Cells(rw, 31).Value, "")
           
            Me.Gross.Value = IIf(FoundMatch, .Cells(rw, 46).Value, "")
            Me.SS.Value = IIf(FoundMatch, .Cells(rw, 47).Value, "")
            Me.PIT.Value = IIf(FoundMatch, .Cells(rw, 48).Value, "")
           
            Me.PCV.Value = IIf(FoundMatch, .Cells(rw, 49).Value, "")
            Me.AddDeduct.Value = IIf(FoundMatch, .Cells(rw, 50).Value, "")
            Me.COLA.Value = .Cells(rw, 51).Value
            Me.NetIncome.Value = IIf(FoundMatch, .Cells(rw, 52).Value, "")
           
            If FoundMatch Then
                RecordRow = rw: resultCount = resultCount + 1
                Me.Caption = "Record " & resultCount & " of  " & MatchCount & "   - Record Row : " & RecordRow
                ' Save row number of matching result for update
                ResultRow = IIf(resultCount >= MatchCount, 0, rw)
                Exit Do
            Else
                Me.Caption = Me.Name
            End If
            rw = rw + 1
        Loop
    End With
   
End Sub

Private Sub cmdUpdate_Click()
    Dim results15   As Variant, resultsEnd As Variant, resultsCalc As Variant
   
    results15 = Array(Me.Pending.Value, Me.Adjustment.Value, Me.AdjustmentDays.Value, Me.NewOldSalary.Value, _
                                Me.Reg1.Value, Me.OT1.Value, Me.WHOT1.Value, Me.WH1.Value, _
                                Me.PO1.Value, Me.RR1.Value, Me.SL1.Value, Me.NWH1.Value, _
                                Me.BER1.Value, Me.WED1.Value, Me.AWOL1.Value, Me.LWOP1.Value)
   
    resultsEnd = Array(Me.Reg2.Value, Me.OT2.Value, Me.WHOT2.Value, Me.WH2.Value, _
                                   Me.PO2.Value, Me.RR2.Value, Me.SL2.Value, Me.NWH2.Value, _
                                   Me.BER2.Value, Me.WED2.Value, Me.AWOL2.Value, Me.LWOP2.Value)
   
    resultsCalc = Array(Me.Gross.Value, Me.SS.Value, Me.PIT.Value, Me.PCV.Value, _
                                    Me.AddDeduct.Value, Me.COLA.Value, Me.NetIncome.Value)
   
    ' Update the corresponding cells in Excel using an array
    With wsTimesheet
        .Cells(RecordRow, 3).Resize(1, 16).Value = results15
        .Cells(RecordRow, 20).Resize(1, 12).Value = resultsEnd
        .Cells(RecordRow, 46).Resize(1, 7).Value = resultsCalc
        .Cells(RecordRow, 35).Value = Me.Comments.Value
    End With
   
    ' Display a message box to confirm that the update was successful
    MsgBox "Employee ID " & searchValue & " - Record Row: " & RecordRow & Chr(10) & "Update successful.", vbOKOnly + vbInformation, "Update Results"
   
End Sub

Private Sub InsertRow_Click()
    Dim lastRow         As Long, newRow     As Long
    Dim rw                   As Long
   
    With wsTimesheet
        ' Get the last row of column A
        lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
       
        ' Loop through each row in column A, starting from the last row and moving upward
        For rw = lastRow To 2 Step -1
            ' Check if the value in column A matches the search text
            If .Cells(rw, 1).Value = searchValue Then
           
                ' If a match is found, insert a new row below the current row and clear its contents
                newRow = rw + 1
                .Rows(newRow).Insert Shift:=xlShiftDown
                .Range("A" & rw).Resize(, 2).Copy Destination:=.Range("A" & newRow)
               
                'update counters
                MatchCount = MatchCount + 1: RecordRow = newRow: resultCount = MatchCount
               
                ' Exit the loop after the first match is found
                Me.Caption = "Record " & resultCount & " of  " & MatchCount & "   - Record Row : " & RecordRow
               
                'inform user
                MsgBox "Employee ID: " & searchValue & Chr(10) & "New Row Added", 64, "New Row Added"
                Exit For
            End If
        Next rw
       
    End With
   
End Sub

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sub GetEmployeeData()
    Dim EmployeeArr     As Variant, ctrl As Variant, m As Variant
    Dim i                        As Long
   
    EmployeeArr = Array(Me.EmployeeName, Me.Jinsiya, Me.Status, Me.Project, Me.Title)
   
    With wsEmployeeInformation
        If Len(searchValue) > 0 Then m = Application.Match(Val(searchValue), .Columns(1), 0) Else m = CVErr(10)
        For Each ctrl In EmployeeArr
            i = i + 1
            ctrl.Value = IIf(Not IsError(m), .Cells(CLng(m), Choose(i, 2, 3, 4, 5, 7)).Value, "")
        Next ctrl
    End With
   
    With wsMasterPay
        If Len(searchValue) > 0 Then m = Application.Match(Val(searchValue), .Columns(1), 0) Else m = CVErr(10)
        Me.Salary.Value = IIf(Not IsError(m), .Cells(CLng(m), 3).Value, "")
    End With
End Sub

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                           UserForm_Initialize Event
'                                                                       DO NOT RENAME THIS EVENT
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub UserForm_Initialize()
    'set worksheet object variables
    With ThisWorkbook
        Set wsTimesheet = .Worksheets("Timesheet")
        Set wsMasterPay = .Worksheets("Master Pay")
        Set wsEmployeeInformation = .Worksheets("Employee Information")
    End With
   
    Me.cmdUpdate.Enabled = False
    Me.InsertRow.Enabled = False
    Me.txtSearch.SetFocus
End Sub

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

When entering an Employee ID in search box & a match is found, the first record in the range should be loaded - you can press “Search” button to move to next matching record. After last record, you will be taken back to the start. To show which record you are viewing, I have added Record & Row counters to the userforms caption bar.

Do understand that I have not included any error handling & only lightly tested the updated code - you will need to adjust to meet real project need as required.


I off now to play football with my grandson

Hope Helpful



Dave
 
Upvote 1
Solution
Hi,

I have had a short play with your project & based on the limited sample data workbook you provided, made an attempt to update your code.

I have assumed that the File workbook provided resides within the Macro workbook i.e. you have just the one workbook?

In normal scheme of things, I would take a different approach coding the userform but due to time limitations, I have sort of stuck with your approach but I have attempted to remove most of the code redundancy (doing the same thing in multiple places) you had



1 – Make a backup of your workbook

2 – Delete ALL existing code in your UserForm code page

3 – Copy & paste to your userform code page all code below




Code:
Option Explicit
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                               MODULE LEVEL VARIABLES
'                                   These variables MUST be at the TOP of the userforms code page OUTSIDE any procedure
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dim ResultRow           As Long, RecordRow As Long
Dim MatchCount         As Long, resultCount As Long
Dim searchValue         As String
Dim wsTimesheet        As Worksheet, wsMasterPay As Worksheet, wsEmployeeInformation As Worksheet

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                                               TEXTBOXES
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub txtSearch_Change()
    searchValue = Me.txtSearch.Value
    'count matches in range
    If Len(searchValue) > 0 Then MatchCount = Application.CountIf(wsTimesheet.Columns(1), searchValue)
    'enable buttons
     With Me.cmdUpdate
        .Enabled = MatchCount > 0
        Me.InsertRow.Enabled = .Enabled
     End With
     'get record
    Call cmdSearch_Click
    GetEmployeeData
End Sub

Private Sub Salary_Change()
    Salary = Format(Salary, "$#,###.00")
End Sub

Private Sub Project_Change()
    'Disable txtAnotherTextBox if txtResultC contains "ABC"
    If InStr(1, Me.Project.Value, ".02.03", vbTextCompare) > 0 Then
        OT1.Enabled = False
        OT2.Enabled = False
        WHOT1.Enabled = False
        WHOT2.Enabled = False
    Else
        OT1.Enabled = True
        OT2.Enabled = True
        WHOT1.Enabled = True
        WHOT2.Enabled = True
    End If
End Sub
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                                      COMMANDBUTTONS
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub cmdSearch_Click()
    Dim rw                  As Long
    Dim FoundMatch  As Boolean
  
    If ResultRow > 0 And resultCount < MatchCount Then
        rw = ResultRow + 1
    Else
        rw = 1
        resultCount = 0
    End If
  
    With wsTimesheet
        Do While rw <= .Cells(Rows.Count, "A").End(xlUp).Row
            FoundMatch = .Cells(rw, 1).Value = searchValue
          
            'Display matching results in textboxes
            Me.Pending.Value = IIf(FoundMatch, .Cells(rw, 3).Value, "")
            Me.Adjustment.Value = IIf(FoundMatch, .Cells(rw, 4).Value, "")
            Me.AdjustmentDays.Value = IIf(FoundMatch, .Cells(rw, 5).Value, "")
            Me.NewOldSalary.Value = IIf(FoundMatch, .Cells(rw, 6).Value, "")
            Me.Reg1.Value = IIf(FoundMatch, .Cells(rw, 7).Value, "")
            Me.OT1.Value = IIf(FoundMatch, .Cells(rw, 8).Value, "")
            Me.WHOT1.Value = IIf(FoundMatch, .Cells(rw, 9).Value, "")
            Me.WH1.Value = IIf(FoundMatch, .Cells(rw, 10).Value, "")
            Me.PO1.Value = IIf(FoundMatch, .Cells(rw, 11).Value, "")
            Me.RR1.Value = IIf(FoundMatch, .Cells(rw, 12).Value, "")
            Me.SL1.Value = IIf(FoundMatch, .Cells(rw, 13).Value, "")
            Me.NWH1.Value = IIf(FoundMatch, .Cells(rw, 14).Value, "")
            Me.BER1.Value = IIf(FoundMatch, .Cells(rw, 15).Value, "")
            Me.WED1.Value = IIf(FoundMatch, .Cells(rw, 16).Value, "")
            Me.AWOL1.Value = IIf(FoundMatch, .Cells(rw, 17).Value, "")
            Me.LWOP1.Value = IIf(FoundMatch, .Cells(rw, 18).Value, "")
          
            Me.Reg2.Value = IIf(FoundMatch, .Cells(rw, 20).Value, "")
            Me.OT2.Value = IIf(FoundMatch, .Cells(rw, 21).Value, "")
            Me.WHOT2.Value = IIf(FoundMatch, .Cells(rw, 22).Value, "")
            Me.WH2.Value = IIf(FoundMatch, .Cells(rw, 23).Value, "")
            Me.PO2.Value = IIf(FoundMatch, .Cells(rw, 24).Value, "")
            Me.RR2.Value = IIf(FoundMatch, .Cells(rw, 25).Value, "")
            Me.SL2.Value = IIf(FoundMatch, .Cells(rw, 26).Value, "")
            Me.NWH2.Value = IIf(FoundMatch, .Cells(rw, 27).Value, "")
            Me.BER2.Value = IIf(FoundMatch, .Cells(rw, 28).Value, "")
            Me.WED2.Value = IIf(FoundMatch, .Cells(rw, 29).Value, "")
            Me.AWOL2.Value = IIf(FoundMatch, .Cells(rw, 30).Value, "")
            Me.LWOP2.Value = IIf(FoundMatch, .Cells(rw, 31).Value, "")
            Me.DaysWorked.Value = IIf(FoundMatch, .Cells(rw, 33).Value, "")
          
            Me.Comments = IIf(FoundMatch, .Cells(rw, 35).Value, "")
          
            Me.TotalAWOL.Value = IIf(FoundMatch, .Cells(rw, 17).Value + .Cells(rw, 30).Value, "")
            Me.TotalLWOP.Value = IIf(FoundMatch, .Cells(rw, 18).Value + .Cells(rw, 31).Value, "")
          
            Me.Gross.Value = IIf(FoundMatch, .Cells(rw, 46).Value, "")
            Me.SS.Value = IIf(FoundMatch, .Cells(rw, 47).Value, "")
            Me.PIT.Value = IIf(FoundMatch, .Cells(rw, 48).Value, "")
          
            Me.PCV.Value = IIf(FoundMatch, .Cells(rw, 49).Value, "")
            Me.AddDeduct.Value = IIf(FoundMatch, .Cells(rw, 50).Value, "")
            Me.COLA.Value = .Cells(rw, 51).Value
            Me.NetIncome.Value = IIf(FoundMatch, .Cells(rw, 52).Value, "")
          
            If FoundMatch Then
                RecordRow = rw: resultCount = resultCount + 1
                Me.Caption = "Record " & resultCount & " of  " & MatchCount & "   - Record Row : " & RecordRow
                ' Save row number of matching result for update
                ResultRow = IIf(resultCount >= MatchCount, 0, rw)
                Exit Do
            Else
                Me.Caption = Me.Name
            End If
            rw = rw + 1
        Loop
    End With
  
End Sub

Private Sub cmdUpdate_Click()
    Dim results15   As Variant, resultsEnd As Variant, resultsCalc As Variant
  
    results15 = Array(Me.Pending.Value, Me.Adjustment.Value, Me.AdjustmentDays.Value, Me.NewOldSalary.Value, _
                                Me.Reg1.Value, Me.OT1.Value, Me.WHOT1.Value, Me.WH1.Value, _
                                Me.PO1.Value, Me.RR1.Value, Me.SL1.Value, Me.NWH1.Value, _
                                Me.BER1.Value, Me.WED1.Value, Me.AWOL1.Value, Me.LWOP1.Value)
  
    resultsEnd = Array(Me.Reg2.Value, Me.OT2.Value, Me.WHOT2.Value, Me.WH2.Value, _
                                   Me.PO2.Value, Me.RR2.Value, Me.SL2.Value, Me.NWH2.Value, _
                                   Me.BER2.Value, Me.WED2.Value, Me.AWOL2.Value, Me.LWOP2.Value)
  
    resultsCalc = Array(Me.Gross.Value, Me.SS.Value, Me.PIT.Value, Me.PCV.Value, _
                                    Me.AddDeduct.Value, Me.COLA.Value, Me.NetIncome.Value)
  
    ' Update the corresponding cells in Excel using an array
    With wsTimesheet
        .Cells(RecordRow, 3).Resize(1, 16).Value = results15
        .Cells(RecordRow, 20).Resize(1, 12).Value = resultsEnd
        .Cells(RecordRow, 46).Resize(1, 7).Value = resultsCalc
        .Cells(RecordRow, 35).Value = Me.Comments.Value
    End With
  
    ' Display a message box to confirm that the update was successful
    MsgBox "Employee ID " & searchValue & " - Record Row: " & RecordRow & Chr(10) & "Update successful.", vbOKOnly + vbInformation, "Update Results"
  
End Sub

Private Sub InsertRow_Click()
    Dim lastRow         As Long, newRow     As Long
    Dim rw                   As Long
  
    With wsTimesheet
        ' Get the last row of column A
        lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
      
        ' Loop through each row in column A, starting from the last row and moving upward
        For rw = lastRow To 2 Step -1
            ' Check if the value in column A matches the search text
            If .Cells(rw, 1).Value = searchValue Then
          
                ' If a match is found, insert a new row below the current row and clear its contents
                newRow = rw + 1
                .Rows(newRow).Insert Shift:=xlShiftDown
                .Range("A" & rw).Resize(, 2).Copy Destination:=.Range("A" & newRow)
              
                'update counters
                MatchCount = MatchCount + 1: RecordRow = newRow: resultCount = MatchCount
              
                ' Exit the loop after the first match is found
                Me.Caption = "Record " & resultCount & " of  " & MatchCount & "   - Record Row : " & RecordRow
              
                'inform user
                MsgBox "Employee ID: " & searchValue & Chr(10) & "New Row Added", 64, "New Row Added"
                Exit For
            End If
        Next rw
      
    End With
  
End Sub

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sub GetEmployeeData()
    Dim EmployeeArr     As Variant, ctrl As Variant, m As Variant
    Dim i                        As Long
  
    EmployeeArr = Array(Me.EmployeeName, Me.Jinsiya, Me.Status, Me.Project, Me.Title)
  
    With wsEmployeeInformation
        If Len(searchValue) > 0 Then m = Application.Match(Val(searchValue), .Columns(1), 0) Else m = CVErr(10)
        For Each ctrl In EmployeeArr
            i = i + 1
            ctrl.Value = IIf(Not IsError(m), .Cells(CLng(m), Choose(i, 2, 3, 4, 5, 7)).Value, "")
        Next ctrl
    End With
  
    With wsMasterPay
        If Len(searchValue) > 0 Then m = Application.Match(Val(searchValue), .Columns(1), 0) Else m = CVErr(10)
        Me.Salary.Value = IIf(Not IsError(m), .Cells(CLng(m), 3).Value, "")
    End With
End Sub

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                           UserForm_Initialize Event
'                                                                       DO NOT RENAME THIS EVENT
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub UserForm_Initialize()
    'set worksheet object variables
    With ThisWorkbook
        Set wsTimesheet = .Worksheets("Timesheet")
        Set wsMasterPay = .Worksheets("Master Pay")
        Set wsEmployeeInformation = .Worksheets("Employee Information")
    End With
  
    Me.cmdUpdate.Enabled = False
    Me.InsertRow.Enabled = False
    Me.txtSearch.SetFocus
End Sub

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

When entering an Employee ID in search box & a match is found, the first record in the range should be loaded - you can press “Search” button to move to next matching record. After last record, you will be taken back to the start. To show which record you are viewing, I have added Record & Row counters to the userforms caption bar.

Do understand that I have not included any error handling & only lightly tested the updated code - you will need to adjust to meet real project need as required.


I off now to play football with my grandson

Hope Helpful



Dave
Thank you so much. When I type the employee ID, the name, status, position, charge code, jinsiya, and salary all pull in correctly before I even hit the search button. However, clicking on search doesn't display any information in the textboxes. I will review the code to see if I can figure out why nothing is showing in my textboxes.

Thanks again for your help. I really appreciate it.
 
Upvote 0
Hi,

I have had a short play with your project & based on the limited sample data workbook you provided, made an attempt to update your code.

I have assumed that the File workbook provided resides within the Macro workbook i.e. you have just the one workbook?

In normal scheme of things, I would take a different approach coding the userform but due to time limitations, I have sort of stuck with your approach but I have attempted to remove most of the code redundancy (doing the same thing in multiple places) you had



1 – Make a backup of your workbook

2 – Delete ALL existing code in your UserForm code page

3 – Copy & paste to your userform code page all code below




Code:
Option Explicit
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                               MODULE LEVEL VARIABLES
'                                   These variables MUST be at the TOP of the userforms code page OUTSIDE any procedure
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dim ResultRow           As Long, RecordRow As Long
Dim MatchCount         As Long, resultCount As Long
Dim searchValue         As String
Dim wsTimesheet        As Worksheet, wsMasterPay As Worksheet, wsEmployeeInformation As Worksheet

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                                               TEXTBOXES
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub txtSearch_Change()
    searchValue = Me.txtSearch.Value
    'count matches in range
    If Len(searchValue) > 0 Then MatchCount = Application.CountIf(wsTimesheet.Columns(1), searchValue)
    'enable buttons
     With Me.cmdUpdate
        .Enabled = MatchCount > 0
        Me.InsertRow.Enabled = .Enabled
     End With
     'get record
    Call cmdSearch_Click
    GetEmployeeData
End Sub

Private Sub Salary_Change()
    Salary = Format(Salary, "$#,###.00")
End Sub

Private Sub Project_Change()
    'Disable txtAnotherTextBox if txtResultC contains "ABC"
    If InStr(1, Me.Project.Value, ".02.03", vbTextCompare) > 0 Then
        OT1.Enabled = False
        OT2.Enabled = False
        WHOT1.Enabled = False
        WHOT2.Enabled = False
    Else
        OT1.Enabled = True
        OT2.Enabled = True
        WHOT1.Enabled = True
        WHOT2.Enabled = True
    End If
End Sub
'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                                      COMMANDBUTTONS
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub cmdSearch_Click()
    Dim rw                  As Long
    Dim FoundMatch  As Boolean
  
    If ResultRow > 0 And resultCount < MatchCount Then
        rw = ResultRow + 1
    Else
        rw = 1
        resultCount = 0
    End If
  
    With wsTimesheet
        Do While rw <= .Cells(Rows.Count, "A").End(xlUp).Row
            FoundMatch = .Cells(rw, 1).Value = searchValue
          
            'Display matching results in textboxes
            Me.Pending.Value = IIf(FoundMatch, .Cells(rw, 3).Value, "")
            Me.Adjustment.Value = IIf(FoundMatch, .Cells(rw, 4).Value, "")
            Me.AdjustmentDays.Value = IIf(FoundMatch, .Cells(rw, 5).Value, "")
            Me.NewOldSalary.Value = IIf(FoundMatch, .Cells(rw, 6).Value, "")
            Me.Reg1.Value = IIf(FoundMatch, .Cells(rw, 7).Value, "")
            Me.OT1.Value = IIf(FoundMatch, .Cells(rw, 8).Value, "")
            Me.WHOT1.Value = IIf(FoundMatch, .Cells(rw, 9).Value, "")
            Me.WH1.Value = IIf(FoundMatch, .Cells(rw, 10).Value, "")
            Me.PO1.Value = IIf(FoundMatch, .Cells(rw, 11).Value, "")
            Me.RR1.Value = IIf(FoundMatch, .Cells(rw, 12).Value, "")
            Me.SL1.Value = IIf(FoundMatch, .Cells(rw, 13).Value, "")
            Me.NWH1.Value = IIf(FoundMatch, .Cells(rw, 14).Value, "")
            Me.BER1.Value = IIf(FoundMatch, .Cells(rw, 15).Value, "")
            Me.WED1.Value = IIf(FoundMatch, .Cells(rw, 16).Value, "")
            Me.AWOL1.Value = IIf(FoundMatch, .Cells(rw, 17).Value, "")
            Me.LWOP1.Value = IIf(FoundMatch, .Cells(rw, 18).Value, "")
          
            Me.Reg2.Value = IIf(FoundMatch, .Cells(rw, 20).Value, "")
            Me.OT2.Value = IIf(FoundMatch, .Cells(rw, 21).Value, "")
            Me.WHOT2.Value = IIf(FoundMatch, .Cells(rw, 22).Value, "")
            Me.WH2.Value = IIf(FoundMatch, .Cells(rw, 23).Value, "")
            Me.PO2.Value = IIf(FoundMatch, .Cells(rw, 24).Value, "")
            Me.RR2.Value = IIf(FoundMatch, .Cells(rw, 25).Value, "")
            Me.SL2.Value = IIf(FoundMatch, .Cells(rw, 26).Value, "")
            Me.NWH2.Value = IIf(FoundMatch, .Cells(rw, 27).Value, "")
            Me.BER2.Value = IIf(FoundMatch, .Cells(rw, 28).Value, "")
            Me.WED2.Value = IIf(FoundMatch, .Cells(rw, 29).Value, "")
            Me.AWOL2.Value = IIf(FoundMatch, .Cells(rw, 30).Value, "")
            Me.LWOP2.Value = IIf(FoundMatch, .Cells(rw, 31).Value, "")
            Me.DaysWorked.Value = IIf(FoundMatch, .Cells(rw, 33).Value, "")
          
            Me.Comments = IIf(FoundMatch, .Cells(rw, 35).Value, "")
          
            Me.TotalAWOL.Value = IIf(FoundMatch, .Cells(rw, 17).Value + .Cells(rw, 30).Value, "")
            Me.TotalLWOP.Value = IIf(FoundMatch, .Cells(rw, 18).Value + .Cells(rw, 31).Value, "")
          
            Me.Gross.Value = IIf(FoundMatch, .Cells(rw, 46).Value, "")
            Me.SS.Value = IIf(FoundMatch, .Cells(rw, 47).Value, "")
            Me.PIT.Value = IIf(FoundMatch, .Cells(rw, 48).Value, "")
          
            Me.PCV.Value = IIf(FoundMatch, .Cells(rw, 49).Value, "")
            Me.AddDeduct.Value = IIf(FoundMatch, .Cells(rw, 50).Value, "")
            Me.COLA.Value = .Cells(rw, 51).Value
            Me.NetIncome.Value = IIf(FoundMatch, .Cells(rw, 52).Value, "")
          
            If FoundMatch Then
                RecordRow = rw: resultCount = resultCount + 1
                Me.Caption = "Record " & resultCount & " of  " & MatchCount & "   - Record Row : " & RecordRow
                ' Save row number of matching result for update
                ResultRow = IIf(resultCount >= MatchCount, 0, rw)
                Exit Do
            Else
                Me.Caption = Me.Name
            End If
            rw = rw + 1
        Loop
    End With
  
End Sub

Private Sub cmdUpdate_Click()
    Dim results15   As Variant, resultsEnd As Variant, resultsCalc As Variant
  
    results15 = Array(Me.Pending.Value, Me.Adjustment.Value, Me.AdjustmentDays.Value, Me.NewOldSalary.Value, _
                                Me.Reg1.Value, Me.OT1.Value, Me.WHOT1.Value, Me.WH1.Value, _
                                Me.PO1.Value, Me.RR1.Value, Me.SL1.Value, Me.NWH1.Value, _
                                Me.BER1.Value, Me.WED1.Value, Me.AWOL1.Value, Me.LWOP1.Value)
  
    resultsEnd = Array(Me.Reg2.Value, Me.OT2.Value, Me.WHOT2.Value, Me.WH2.Value, _
                                   Me.PO2.Value, Me.RR2.Value, Me.SL2.Value, Me.NWH2.Value, _
                                   Me.BER2.Value, Me.WED2.Value, Me.AWOL2.Value, Me.LWOP2.Value)
  
    resultsCalc = Array(Me.Gross.Value, Me.SS.Value, Me.PIT.Value, Me.PCV.Value, _
                                    Me.AddDeduct.Value, Me.COLA.Value, Me.NetIncome.Value)
  
    ' Update the corresponding cells in Excel using an array
    With wsTimesheet
        .Cells(RecordRow, 3).Resize(1, 16).Value = results15
        .Cells(RecordRow, 20).Resize(1, 12).Value = resultsEnd
        .Cells(RecordRow, 46).Resize(1, 7).Value = resultsCalc
        .Cells(RecordRow, 35).Value = Me.Comments.Value
    End With
  
    ' Display a message box to confirm that the update was successful
    MsgBox "Employee ID " & searchValue & " - Record Row: " & RecordRow & Chr(10) & "Update successful.", vbOKOnly + vbInformation, "Update Results"
  
End Sub

Private Sub InsertRow_Click()
    Dim lastRow         As Long, newRow     As Long
    Dim rw                   As Long
  
    With wsTimesheet
        ' Get the last row of column A
        lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
      
        ' Loop through each row in column A, starting from the last row and moving upward
        For rw = lastRow To 2 Step -1
            ' Check if the value in column A matches the search text
            If .Cells(rw, 1).Value = searchValue Then
          
                ' If a match is found, insert a new row below the current row and clear its contents
                newRow = rw + 1
                .Rows(newRow).Insert Shift:=xlShiftDown
                .Range("A" & rw).Resize(, 2).Copy Destination:=.Range("A" & newRow)
              
                'update counters
                MatchCount = MatchCount + 1: RecordRow = newRow: resultCount = MatchCount
              
                ' Exit the loop after the first match is found
                Me.Caption = "Record " & resultCount & " of  " & MatchCount & "   - Record Row : " & RecordRow
              
                'inform user
                MsgBox "Employee ID: " & searchValue & Chr(10) & "New Row Added", 64, "New Row Added"
                Exit For
            End If
        Next rw
      
    End With
  
End Sub

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Sub GetEmployeeData()
    Dim EmployeeArr     As Variant, ctrl As Variant, m As Variant
    Dim i                        As Long
  
    EmployeeArr = Array(Me.EmployeeName, Me.Jinsiya, Me.Status, Me.Project, Me.Title)
  
    With wsEmployeeInformation
        If Len(searchValue) > 0 Then m = Application.Match(Val(searchValue), .Columns(1), 0) Else m = CVErr(10)
        For Each ctrl In EmployeeArr
            i = i + 1
            ctrl.Value = IIf(Not IsError(m), .Cells(CLng(m), Choose(i, 2, 3, 4, 5, 7)).Value, "")
        Next ctrl
    End With
  
    With wsMasterPay
        If Len(searchValue) > 0 Then m = Application.Match(Val(searchValue), .Columns(1), 0) Else m = CVErr(10)
        Me.Salary.Value = IIf(Not IsError(m), .Cells(CLng(m), 3).Value, "")
    End With
End Sub

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'                                                                           UserForm_Initialize Event
'                                                                       DO NOT RENAME THIS EVENT
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub UserForm_Initialize()
    'set worksheet object variables
    With ThisWorkbook
        Set wsTimesheet = .Worksheets("Timesheet")
        Set wsMasterPay = .Worksheets("Master Pay")
        Set wsEmployeeInformation = .Worksheets("Employee Information")
    End With
  
    Me.cmdUpdate.Enabled = False
    Me.InsertRow.Enabled = False
    Me.txtSearch.SetFocus
End Sub

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

When entering an Employee ID in search box & a match is found, the first record in the range should be loaded - you can press “Search” button to move to next matching record. After last record, you will be taken back to the start. To show which record you are viewing, I have added Record & Row counters to the userforms caption bar.

Do understand that I have not included any error handling & only lightly tested the updated code - you will need to adjust to meet real project need as required.


I off now to play football with my grandson

Hope Helpful



Dave
It works like a charm! Thank you again for all your help.
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,261
Members
448,558
Latest member
aivin

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