I'm even ashamed of asking but what is the difference in using Environ("USERNAME") or Environ$("USERNAME")?
And from my readings, coders advice to use an "Option Explicit" factor. Why? And where to you put it in your code?
EDIT: For instance, I deviced the following code from help from all around. I placed a question regarding part of it last week here but no answer, and I needed help on something related on MrExcel, but I figured it already, so I'll advice them shortly:
Private Sub Workbook_Open()
Dim UserName As String
UserName = Environ$("USERNAME")
Select Case UserName
Case "bwag", "myo", "dbadalez", "erosa", "msoa"
x = Sheets("Department1").Columns(2).SpecialCells(2).Address
ThisWorkbook.Sheets("Summary").ComboBox1.List = Sheets("Department1").Columns(2).SpecialCells(2).Value
Case "ron2k_1"
ThisWorkbook.Sheets("Summary").ComboBox1.List = Sheets("Department1").Range("B8:C18").Value
Case "my_boss"
ThisWorkbook.Sheets("Summary").ComboBox1.List = Sheets("Department2").Columns(2).SpecialCells(2).Value
End Select
End Sub
As you notice my code is novice, do I need the Option Explicit thingy (or anything else) there? So far it works, so I'm so proud of myself...
Thanks,
Bookmarks