How do I put a variable worksheet in a RowSource? I am trying to concatenate with the last line but it is giving error:
Private Sub UserForm_Initialize()
Dim plan As Worksheet
Dim lin As Range
Dim fim As Range
Optionapos = True
If Optionapos = True Then
Set plan = Worksheets("CadReu")
Else
Set plan = Worksheets("CadReuOlde")
End If
With plan
'atualiza a caixa localizar
Dim totaldelinhas As Integer
totaldelinhas = plan.UsedRange.Rows.Count
'formreunioes.cxLocalizar2.ColumnCount = .Columns.Count
formreunioes.cxLocalizar2.RowSource = .Range("A1:A" & totaldelinhas)
End With