Always I am indebted.

From the text box in the user form created by the macro, enter the set value
I'm trying to get it
"Object variable or with block variable not set"
I get an error and it doesn't work.

I think the path is correct ...
(Object name of user form. Object name of text box. Value)

The code description is a standard module.

I would appreciate it if anyone could teach me.

Function getTasks_1 () As String ()
Dim task As String
Dim taskDetails As String
Dim workHour As String
Dim progress As String
task = UserForm1.TextBox_Work content ①.Value
taskDetails = UserForm1.TextBox_Details of work contents ①.Value
workHour = UserForm1.TextBox_Man-hours ①.Value
progress = UserForm1.TextBox_Progress ①.Value
Dim tasks (3) As String
tasks (0) = task
tasks (1) = taskDetails
tasks (2) = workHour
tasks (3) = progress
getTasks_1 = tasks
End Function
  • Answer # 1

    It was my careless mistake, and I am very sorry for those who cooperated!
    Thank you, meg_, for your inconvenience through the comments!

Related articles