ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programmatically show and hide portions of worksheet? (https://www.excelbanter.com/excel-programming/395824-programmatically-show-hide-portions-worksheet.html)

zz12

Programmatically show and hide portions of worksheet?
 
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.



joel

Programmatically show and hide portions of worksheet?
 
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


"zz12" wrote:

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.





All times are GMT +1. The time now is 12:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com