PDA

View Full Version : Mask the Salary



gnod
06-06-2007, 09:18 AM
Does anyone know how to mask it with asterisk? for example when i input the salary (15000) in a cell it will turn to *****..
thanks..

mdmackillop
06-06-2007, 09:22 AM
You could change the font to Wingdings!

Bob Phillips
06-06-2007, 09:36 AM
Best to use a userform as that has a password character property on textboxes.

Bob Phillips
06-06-2007, 09:37 AM
Or you could even use the camera to reflect a different cell.

But of course the real value is there and can be seen with a simple =A1.

gnod
06-06-2007, 10:07 AM
even if i change the font it will be visible in the formula bar..
and i can't use the userform because my excel file is like in this format and i don't know how many employees are..
is there any other way using vba to change it to asterisk?

unmarkedhelicopter
06-06-2007, 10:24 AM
No, this can't be done.
If you write code that allows you to enter a number it is displayable until you press enter. You can then replace the value with an encrypted version, but if you then want to see the actual value you would need to run some code to decrypt it (after prompting you for a password maybe)
Why not write it in a white cell with a white font and then protect the sheet with the relevant settings on the cells ?

gnod
06-06-2007, 10:34 AM
the salary will be inputted by the user, the reason why i'm doing this is to prevent others see the salary of the employee..

ok, thanks to all for your reply..
thanks..

lucas
06-06-2007, 10:34 AM
or hide the formula bar

johnske
06-06-2007, 03:07 PM
You can use your controls toolbar to insert a textbox in the cell, then format it so it look like an ordinary cell and use its PasswordChar property to conceal what's in there :)

unmarkedhelicopter
06-06-2007, 04:48 PM
Sorry, but if they are being entered by the user, the encryption system will work, the encryption is done via a change in a cell and the user (any user) can't decrypt it. Then You come along and have a macro that asks do you wish to encrypt or decrypt column J (say) if decrypt it asks you for a pass phrase, it then makes all values readable.
The only problem with this is that user B 'may' enter another value for user A's salary and you would not know.
Another issue is that user B could just keep entering different values in his salary field until it matches user A's field, then he'd know. This could be got round with a second encrypted field with stores an encrypted randomly generated pass phrase for the salary field.
So your pass phrase decrypts the salary pass phrase which decrypts the salary.
It can be done but it ain't easy !

gnod
06-07-2007, 10:21 AM
this is an overview of my employee info sheet.. i'm thinking to put a button above the Monthly Salary of New Employee table and Transfer Table with a caption of "Mask Salary" if they will press the button it will mask to asterisk but still the amount in the salary column can be use for computation..

this is the code from the button of Insert Row from New Eployee Table and Transfer Table..


Sub procEXP_InsertRow_EmpInfoSheet_NewEmp()
With Application
.ScreenUpdating = False
With .ActiveSheet
.Unprotect modExpMisc.strPassword
With .Range("EXP_InsertRow_EmpInfoSheet_NewEmp")
.EntireRow.Insert
.Offset(-2, 0).EntireRow.Copy
.Offset(-1, 0).PasteSpecial xlPasteAll
End With
.Protect modExpMisc.strPassword
End With
.ScreenUpdating = True
End With
End Sub

Sub procEXP_InsertRow_EmpInfoSheet_TransferEmp()
With Application
.ScreenUpdating = False
With .ActiveSheet
.Unprotect modExpMisc.strPassword
With .Range("EXP_InsertRow_EmpInfoSheet_TransferEmp")
.EntireRow.Insert
.Offset(-2, 0).EntireRow.Copy
.Offset(-1, 0).PasteSpecial xlPasteAll
End With
.Protect modExpMisc.strPassword
End With
.ScreenUpdating = True
End With
End Sub


Thanks

unmarkedhelicopter
06-07-2007, 04:47 PM
Should not HR be doing this ?

gnod
06-07-2007, 09:28 PM
i'm working with the finance dept for their budget.. this sheet is included with the expense statement.. (employee's salary, benefits,..)