• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

select case e if- vba

  • Thread starter Thread starter SimoneCRV
  • Start date Start date

SimoneCRV

Guest
Good morning,
someone can explain why the first case doesn't work, but the second one does?
I don't give it out, thank you. o

1stcase
select houses swsubdim.name
houses is = "h_terra": swsubdim.value = userform1.h_terra
end select

2ndcase
if swsubdim.name = "h_terra" then
swsubdim.value = userform1.h_terra
end if

considering that I have a lot of odds to check, I didn't want you to pass all by if, a select case seemed faster
 
Last edited:
I did not try, but being two different methods could behave in different ways. in the first case sometimes does not accept that the value (in this case the name of the quota) is calculated by the select case. you could then dimension a string variable first in this way:

dim name_quota as string
name_quota=swsubdim.name

select houses name_quota
houses is = "h_terra": swsubdim.value = userform1.h_terra
end select

test and see if so turns
 
I did not try, but being two different methods could behave in different ways. in the first case sometimes does not accept that the value (in this case the name of the quota) is calculated by the select case. you could then dimension a string variable first in this way:

dim name_quota as string
name_quota=swsubdim.name

select houses name_quota
houses is = "h_terra": swsubdim.value = userform1.h_terra
end select

test and see if so turns
thank you, but I solved with the classic function "revvia il pc"
Then it all came back to turn as I expected.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top