0

So i have different userforms that i'm trying to use to register logins in my excel workbook. However i can't find a way to use the variables that i created in the first userform (The login one) on the last userform (Logout). For instance, if the person is logged in as Mr. Smith the variable X has the text Mr. Smith however i don't know how i can use that variable X on the logout userform in order to register that Mr.Smith has logged out.

On the login userform i have them like this

 Dim U As Integer
 Dim numU As Integer
 Dim wordU As String
 Dim codU As String

...

Sheets("Registos").Select

ThisWorkbook.Sheets("Registos").Cells(LinX, 1).Value = numU           
ThisWorkbook.Sheets("Registos").Cells(LinX, 2).Value = wordU       
ThisWorkbook.Sheets("Registos").Cells(LinX, 3).Value = Now()       

I want to register the person that logs out of the program based on the his identity when he logged in.

  • https://stackoverflow.com/a/53412401/7599798 – FunThomas Feb 15 '19 at 14:20
  • Different ways of doing this: 1. you can declare a `Public` variable in a `Module` which will be visible to your project. 2. Personally, I would declare local variables in your form and have a public method that will allow you to get the value. Never been a big fan of public variables – Zac Feb 15 '19 at 14:24

0 Answers0