Hallö All,
in the code below i become a error code 2029
This is the resault of cell "J1"
if I Change it manualy in Excel to: ("drayson")
Code
=I1=(INDEX(Berechtigung!E:E,MATCH("drayson",Berechtigung!B:B,0)))
[/code
I become the answer I require ="A" so the Problem is that the "UserName" is not given on as a text?
Following is the full code that will not work:
[code]
Public Sub Start()
Dim Masterwb As Workbook
Dim MyName As String
Dim MyGroup As Variant
Dim LoginName As String
Dim ws As Worksheet
Dim Berechtigung As Worksheet
' Application.ScreenUpdating = False
'UnProtect all Sheets
For Each ws In Worksheets
ws.Unprotect Password:="XYZ123"
Next
Set Masterwb = ActiveWorkbook
Set Berechtigung = ActiveSheet
'Get User Name from Windows Login
MyName = Environ("Username")
Berechtigung.Select
Range("J1").Select
' ActiveCell.FormulaR1C1 = "=IFERROR(INDEX(Berechtigung!E:E,MATCH(" & MyName & ",Berechtigung!B:B,0)),"""")"
LoginName = "=(INDEX(Berechtigung!E:E,MATCH(" & MyName & ",Berechtigung!B:B,0)))"
' 'MyGroup = Cstr(activcell.Value)
Range("I1").Select
ActiveCell.FormulaR1C1 = "=(Cells(1, J).Value = "" & Cells(1, J).Value )"
If Range("I1").Value = "A" Then Call ALPHA
If Range("I1").Value = "B" Then Call BRAVO
If Range("I1").Value = "C" Then Call CHARLIE
EndIf
Display More
I have looked all over the net but nothing seams to work? has any one an idea how to get around my Problem? all help is apreashiated
Ray