fgarcia90 Posted July 11, 2012 at 01:53 AM Report Share #468259 Posted July 11, 2012 at 01:53 AM Boas, sou novato em VBA e estou a tentar iniciar um programa no excel. Na sheet2 tenho na coluna A uns utilizadores de windows e na coluna B outros Coloquei o código num modulo e consigo obter o utilizador do windows mas não consigo obter os valores dos utilizadores e compara-los com o utilizador de windows para depois consoante atribuir como pessoal duma secção ou de outra. Sub seccao() Dim user As Variant user = Environ("USERNAME") Dim seccao_type As String If user = Sheet2.Range("A1:A20").Value Then seccao_type = "Tecnica" ElseIf user = Sheet2.Range("B1:B20").Value Then seccao_type = "Comercial" End If MsgBox seccao_type End Sub Obrigado Link to comment Share on other sites More sharing options...
jpaulino Posted July 11, 2012 at 09:18 AM Report Share #468279 Posted July 11, 2012 at 09:18 AM Não entendi ... não podes mostar um exempo? Link to comment Share on other sites More sharing options...
fgarcia90 Posted July 12, 2012 at 04:19 PM Author Report Share #468494 Posted July 12, 2012 at 04:19 PM já me safei desta... thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now