Type mismatch in excel Form

KhallP

Board Regular
Joined
Mar 30, 2021
Messages
157
Office Version
  1. 2016
Platform
  1. Windows
when I start my form I'm getting the error "Type Mismatch"

Code:

Code:
Private Sub UserForm_Initialize()
    
Dim split_name() As String, name_person As String
Dim c As Long, contar_usuarios As Long

Workbooks(OtherBookPath).Sheets("Usuários").Activate

contar_usuarios = Cells(Rows.Count, "B").End(xlUp).Row

For c = 1 To contar_usuarios
    
        Cells(c, 4).Select
    
        Select Case True
        
        Case ActiveCell = nome_usuario
            name_person = ActiveCell.Offset(0, -1).Text
            
        End Select
            
Next c

Workbooks(CurrentBookPath).Activate
Application.ScreenUpdating = True

split_name = Split(name_person, "")

lb_hours.Caption = Format(Now, "hh:mm")
lb_tipo_de_correc.Caption = split_name(0)

End Sub


Can someone help me?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
You're not telling us on which line the error occurs. On the error dialog click on Debug, the VBE opens and shows you which line is responsible for the run-time error (yellow marked).
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

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