Not sure if this is possible.
I have a userform with several line items. The text fields on each line carry names like Title1, Edition1, Title2, Edition2 etc. I want to call sub that will change the number in the field name. I tried the following:
I also tried "Title" & lineNumber but had the issue that the object name isn't seen as Title1, Title2 etc. Is there a way to have variable field names to run the VBA code?
Thanks in advance.
I have a userform with several line items. The text fields on each line carry names like Title1, Edition1, Title2, Edition2 etc. I want to call sub that will change the number in the field name. I tried the following:
VBA Code:
dim lineNumber as string
lineNumber = 1
Call CreateForm
lineNumber = 2
CallCreateForm
sub CreateForm()
if Title & lineNumber.Value <> "" then
' code here
end if
end sub
I also tried "Title" & lineNumber but had the issue that the object name isn't seen as Title1, Title2 etc. Is there a way to have variable field names to run the VBA code?
Thanks in advance.