LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
sgh sgh is offline
external usenet poster
 
Posts: 1
Default VBA / IF - Then / Custom Toolbar

Hello,

I'd like to have custom tool bar appear for "approved" users only.
can see different approaches, but cannot find the light at the end o
the tunnel.

worksheet 'support'
Range 'A40:A50' [named 'users'] lists approved user log-ins.
Cell A51 = '=username()' <see code at the end
Cell A52 = '=COUNTIF(Users,A51)

If VBA code can confirm that the current user log-in is in rang
'users' and then display the custom toolbar 'special', or dont d
anything would be preferred and i can delete cells A51/A52.

Maybe VBA can check if A52<1 and not show the toolbar (or if A52=
show the toolbar)?

I'd assume that it would be something like IF(Cell/Range)="1", or I
Cell/Range contains Username then display toolbar ELSE nothing End Sub
I canot figure the right coding.

Thank you for your assistance.

Stefan

---------------
With some assistance some time again i have this code to get th
username.
---------------
Option Explicit
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, ByRef nSize As Long) As Long
---------------
Function UserName() As String
Dim stBuff As String * 255, lResult As Long, lBufflen As Long
lBufflen = 255
lResult = GetUserName(stBuff, lBufflen)
If lBufflen 0 Then UserName = Left(stBuff, lBufflen - 1)
End Function
--------------

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Toolbar user Excel Discussion (Misc queries) 1 March 17th 09 05:33 AM
Custom Toolbar hfazal Excel Discussion (Misc queries) 2 September 15th 07 01:32 PM
custom toolbar buttons are saved where? Excel loads twice bymistake and all my custom toolbar buttons get gone!!! Kevin Waite Excel Programming 2 March 3rd 04 03:31 PM
Custom toolbar in C# Matt Excel Programming 0 January 16th 04 05:01 PM
saving toolbar buttons on custom toolbar Paul James Excel Programming 12 August 6th 03 08:28 AM


All times are GMT +1. The time now is 12:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"