Programmatically show and hide portions of worksheet?

  • Thread starter Thread starter zz12
  • Start date Start date
Z

zz12

Hello. Would anyone know if it's possible to have a user use their windows
domain login to log into an asp page that has an excel file link in which it
will open the excel file and somehow show and hide only portions of the
excel worksheet based on their windows domain credentials?

Thanks in advance.
 
There are lot of environment variabels. To see them go to start button.
Select Run and type in run box cmd. then in DOS window type set. The VBA
function environ reads these variable in the same order as you see them in
DOS. The code below gets the USERNAME variable.

Sub test()

Dim EnvString, Indx, Msg, PathLen ' Declare variables.
Index = 1 ' Initialize index to 1.
Do While Environ(Index) <> ""
If InStr(Environ(Index), "USERNAME") Then
Exit Do
End If
Index = Index + 1
Loop

UserName = Environ(Index)
Columns("E:G").EntireColumn.Hidden = True


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top