Unprotect Cell Based On Username Match

Dec 14, 2006


Sheets("sheet1").Range("a1").Value = Environ("username")

If Range("a1").Value = Range("H5").Value Then format.cell("c24")Protection=unlocked

I will have someone type in their supervisor's name in H5. When they send the form to their supervisor and A1 matches the entry in H5, I want cell c24 to be unlocked so the supervisor can make an entry.

View 9 Replies


ADVERTISEMENT

Find Username Match And Pull All Data At Same Row W/username

Oct 5, 2007

I have a thousand names on a column, and I have a several worksheet tabs as locations, such as CA, AZ, TX, and NY.

All names goes to main worksheet, show like this

apitchford 10 100 123
bkishpaugh 9 211 123
blee 14 234 111
cbonny 21 125 412

I need to pull a specific name, example, name = blee, move that name with all data on that row into TX.

I will need to set as automatically, becuase the names add and delete on the main worksheet, and will auto update those tab worksheets. (make sense?)

I have tried INDEX and MATCH, but they keep putting one data in, not all data.

View 9 Replies View Related

Protect Or Unprotect Cells Based On Cell Input

Nov 21, 2006

I am working on my spreadsheet and was wondering if anyone knows if cells can be Protected or Unprotected based on the value of another cell?

Here is what I am looking for:

If cell "A16" on the "Input Sheet" equals AR then Protect Cells J16, K16, L16, M16, N16, and O16

If the value of A16 on the Input Sheet DOES NOT equal AR then leave those cells unprotected.

Has anyone ever done anything like this? On my spreadsheet it would allow the user to skip the unnecessary cells as opposed to having to Tab through them. Not a big deal but definitely would be a time saver and a lot more user friendly.

If you have any questions or concerns just let me know. I will wait to see what the Excel Guru's come up with.

View 9 Replies View Related

Require Password To Open If Username Does Not Match A List

Aug 8, 2014

I have a spreadsheet (don't we all) that is currently password protected - you double click the file and need to input a password before it will open.

I have some code that will protect a workbook from changes and only unlock for specific usernames, and i wonder if there is some code that will do the following:

-User opens spreadsheet
-VBA looks at the username trying to open the sheet, for this example the username is Paul.Smith
-Paul.Smith is not one of the people who should have regular access to this sheet - so the VBA requests a password from him prior to opening the sheet.

My username opens the same sheet (galvin.paddy), VBA see's that my name is one of the 'Authorised Users', removes the password and opens the sheet for me ready for use.

View 14 Replies View Related

Save To Directory Based On Username?

May 20, 2013

I have a button that saves my excel workbook to a network drive, but what I'd like to do is have it save the file to a directory named after the user, instead of all the users in the department saving to one folder. For instance, R:customerserviceweight reconstructionusername, where username a directory named after the user.

Code:
Private Sub Save_Click()Dim Path As String
Dim FileName1 As String
Dim FileName2 As String
FileName1 = Range("A2")
FileName2 = Range("A3")
ActiveWorkbook.SaveAs Filename:="R:CustomerServiceWeight Reconstruction" & FileName1 & " - " & FileName2 & " - " & Format(Date, "yyyymmdd") & ".xlsm", FileFormat:=52
End Sub

View 1 Replies View Related

Sorting Based On Category And Username

Mar 25, 2008

I have imported a list of information from a text file created by my network admin. I need to take the information from different categories in the list and sort them by category. All of the information is in once cell, but each has a common prefix (ie. URL = or Username), etc. After each prefix is the information I'd like to sort under the category (each category is the prefix). All of the information (prefix & data) is in cell A because it was a text file, and I'd like to simply find a way to say if A10 = URL= then place the information in C10...Below is what I need to sort.

URL = [url]
User Name =
Source IP = 0.0.0.0
Destination IP = 12.345.67.89

Disposition = CATEGORY_BLOCKED
Lookup Code = WISP_URL_BLOCKED
Category = Proxy Avoidance

Elapsed Time = 0 ms

AVG TIME PER REQUEST = 0 ms

------------------------------------------
Sending URL_LOOKUP_REQUEST_EX...
------------------------------------------

URL = [url]
User Name =
Source IP = 0.0.0.0
Destination IP = 123.456.789.101

Disposition = QUOTA_USER_BLOCKED
Lookup Code = WISP_URL_BLOCKED
Category = Social Networking and Personal Sites

Elapsed Time = 0 ms

AVG TIME PER REQUEST = 0 ms

View 9 Replies View Related

Getting Username From System In A Cell

Apr 17, 2009

I am trying to get the username from the system to display in A1 in a file in Excel. I got this code form internet and put it in the sheet by clicking right mouse on the sheet1 tab and view code and then pasted it there.

Function UserNameWindows() As String
UserNameWindows = Environ("USRNAME")
End Function

And then as per the instructions on the same page I inserted this formula in A1 : =UserNameWindows()

The person stated that by doing this, I should be able to get user name displayed in A1. BUt all it gives me is #NAME?.

View 9 Replies View Related

Adding Timestamp And Username To Cell After Previous Cell Edited

Apr 24, 2014

Trying to get a record of who authorized spending in one of my worksheets and when they did it

I had some VBA code in one of my worksheets which added a time stamp and a user ID to two different cells after the user enters their name. Why it is no longer working, though I suspect after moving the worksheet around.

I would like my users to type their name into cell G65 (which is actually merged from G65-K65). Once the user enters their name, cell L65 (which is actually merged L65-O65) populates with the current time stamp. Also, when the user enters their name into cell G65, I would like cell P65 (which is actually merged into P65-S65) to auto populate. I would like this all of this to go down through line 70.

View 1 Replies View Related

Including Environment Username In Cell

Feb 1, 2006

I have searched the forum several way to resolve my issue and the only solutions were as follows:

PHP
Public Function UserName()UserName = Environ("username")UserName = Computer("UserName")End FunctionOption ExplicitFunction NetworkUserName() As StringDim responseNetworkUserName = Environ("Username")End Function 

Problem is that I get a #REF! and #NAME? instead of the user names
I am using Excel 2000 (I can not upgrade, Government PC) plus we need it to support Excel 2000 - present versions.

View 13 Replies View Related

Unprotect Single Cell Only

Jul 10, 2012

I have a spread sheet that is protected. I would like to have cell G5 unprotected when a checkbox is checked. I am able to unprotect the entire sheet by checking the box but I only want G5 unprotected. My current macro that unprotects the entire sheet is

Sub Checkbox_Clear2()
Sheets("Input_Personnel").Unprotect ("1")
If Range("J12") = False Then Range("G5").ClearContents
End Sub

Is there a way to change the highlighted line where it only unprotects cell "G5".

View 1 Replies View Related

Excel 2010 :: Recovering Username On Specified Cell

Oct 4, 2013

Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long

Public Function UserName() As String
Dim Buffer As String * 100
Dim BuffLen As Long
On Error GoTo UNerr

[Code] ......

I found the code online and attempted to call the user name using =username() on the specified cell, but I receive the #NAME? error. I looked around and found several references to check the VB refence box for anything missing and I did not find anything incorrect.

To note, I am attempting this at my job's PC which will be used on other employees PC's as well.

View 6 Replies View Related

Username Entered In Cell When Validation List Is Used?

Apr 25, 2014

Is there a way to have a formula or a VBA code associated to the choice of any value in a Validation list.

For example is there a way to have lets say in A1 a validation list and to have B2 returning the username of the person of who will select a value in A1?

View 9 Replies View Related

Call Password Username Before Cell Entry?

Jun 23, 2014

I trying to create a paperless petty cash system. I have my sheet all setup and calculating how I want. When a user makes an entry they Enter their name in column "W".

I am trying to overcome the problem of accountability. I need to achieve a cell calls for Username and Password and if correct the persons name is entered into cell then Row is locked to prevent figures being altered etc. But also if user made mistake they need to unlock it somehow someway

Sure this achievable from snippets of info I seen online but its way beyond my abilities. I realise a determined user can circumvent this if they wanted to.

View 5 Replies View Related

How Do I Insert A Cell Based On Its Match With An Adjacent Cell

Jan 20, 2006

There's got to be a way to do this (mail merge style perhaps...) I would like to insert the entry/ies under a heading in a table in one worksheet whenever that heading matches the data entered in a separate worksheet.

Presently I can find no way to do this in Excel.

View 12 Replies View Related

Customised Prompt When Trying To Unprotect A Protected Cell

Jun 12, 2009

when the user tries to enter data into Ranges E25:E26, G25:G26 OR I25:I26 I want to have my own customised prompt that says: "You are using Imperial Units. Enter drafts in the Imperial range by clicking the Imperial button on the left".

To make it more interesting, the cursor should go to the range that I have named 'Imperial', when the user clicks on the 'OK' button of the above prompt.

View 14 Replies View Related

Code To Protect And Unprotect Cell Ranges?

Jan 28, 2014

following code so as to have certain cell ranges protected and unprotected USING COMMANDBUTTON/PASSWORD

Code:
Private Sub CommandButton1_Click()
Dim Password As String
JamesPassword = "MyPassword" '

[Code]......

View 8 Replies View Related

Get Username & Text From User To Use With Date & Time In Cell Comment

Jun 22, 2008

i have the following code to insert comments into cells, however if the user cancels the input box (i.e. doesn't insert any text), a comment is still added with their details and the comment 'FALSE'. Is there anyway to stop comments being added if the user cancels the input?

Sub Insert_Comment()
Dim iReply As Integer

Dim cl As Range
Dim sComment As String
Dim sText As String
Dim UserNameWindows As String

View 4 Replies View Related

Match Interior Color Of Cell Based On Value?

May 10, 2012

I have 2 different worksheets...each of them containing item numbers. On Sheet1, Column A contains the item numbers. I have conditional formatting to change the interior color of column A based on several criteria.

On Sheet2, I also have item numbers, but they are located in Column B. If item 12345 in Column A on Sheet1 has an interior color of yellow, I would like that same item on Sheet2 to have an interior color of yellow.

View 7 Replies View Related

Formatting Cell Based On Match In A Range

Mar 22, 2007

I have two sheets (Results and August) with numbers in column A, I want to change the color of the cell on Results if its contents matches the number on August. I was feeling adventurous today, so I tried writing some VBA code, but it changes the color of ALL the cells. What am I missing?

Sub FindMatches()
'Compares student numbers on Results sheet to those on August sheet; if match is found then highlights the student number
Dim Sht1Rng As Range
Dim Sht2Rng As Range
Set Sht1Rng = Worksheets("Results").Range("A1", Worksheets("Results").Range("A65536").End(xlUp))
Set Sht2Rng = Worksheets("August").Range("A1", Worksheets("August").Range("A65536").End(xlUp))
Set d = Nothing
For Each C In Sht1Rng
Set d = Sht2Rng. Find(C.Value, LookIn:=xlValues)
If Not d Is Nothing Then
Sht1Rng.Interior.ColorIndex = 10
Set d = Nothing
End If
Next C
End Sub

I suspect that I shouldn't be using sht1rng.Interior.Colorindex, as I think that may color the entire range? What should I use instead?

View 8 Replies View Related

Automatically Add Username, Current Date And Time Each Tiime Any Cell Is Changed

Feb 27, 2009

I am looking to have a macro which will automatically add the username and date to a cell, when the cell above changes (or in this case =x). I have a bit of code from a previous project, but I have changed Target.Row to Target.Column and it is not behaving as I require:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("B2:BZ2"), Target) Is Nothing Then
Range("C" & Target.Column).Value = Format(Date, "dd-mmm") & " " & Format(Time, "hh:mm") & " by " & (Application.UserName)
End If
End Sub

See the attachment for the example. What I need is whenever row 3 ="x" I need the corresponding cell in row "d" to update with the latest date, time and username. Please not the macro is currently not active on the sheet as i've added the ' character.

View 3 Replies View Related

Index / Match Return Header Value Based On Row And Cell Value

Apr 24, 2012

I have a rather large table that I need to return the column heading from.

Within the table I have a list of Names in the left most Column (A) and a list of Percentiles in the header row (row 2) (incrementing by 5%). By inputting the name and a cell value I am trying to return the column header.

Using an example;

5% 10% 15%
Bob 3.5 4.1 4.15
John 3.6 4.2 4.30
Chris 3.3 4.9 4.95
Sammy 3.7 4.6 4.7

Like I said, knowing the name and the cell value, I want to return the percentage value. So for example, Bob would be one input value, and another input value would be 4.1. I would want excel to return 10%.

I have found different suggestions using a combination of index/match but even using these functions I cannot get it to return the COLUMN value instead of a cell value.

View 8 Replies View Related

VBA To Colour Cell On Each Line Based On Date Match

Nov 25, 2013

I have a row which contains a date header.

Under this there are multiple lines of activities each with a different end date and empty cells under the calendar headers so that people can enter how long they have worked against that project.

What I want to do is to compile a VBA coded which will cycle each line and at the intersection of where the end date and header match to colour that cell in a defined colour.

An example below:

Date
Colour
01 Jan
02 Jan
--->

[Code]......

View 8 Replies View Related

Excel 2007 :: Change Username In Mouseover Status Bar Message For Cell Comments?

May 30, 2012

I am having with Excel 2007.

When I hover the mouse over a cell with comments, the status bar displays a message; for example "Cell A12 commented by A satisfied Microsoft Office user".

I only get this message for one column. The cells in all other columns give my first and second name as the author of the cell comment.

Why it is only effecting one column. I have been unable to change the annoying "commented by A satisfied Microsoft Office user" to my own name.

Is there a macro that can do this? I tried two macros I found online, both from a few years back, but neither of them worked.

View 2 Replies View Related

Macro That Searches For Partial Match Then Apply IF Statement Based On Match

Sep 21, 2013

I have a WB with multiple sheets. I have a Feed sheet that automatically pulls data from the web. I have a Scores sheet that currently has all head to head matchups each week for an entire season. So I want to check the cells on the Feed! sheet to find a partial match and if partial match exists then copy cell that contents score from feed sheet to the score sheet next to the appropriate teams name. Currently I have to manually enter all scores each week for the rest of my WB to update.

I need to look at Cell A3 (on the Feed sheet) which has "New York Jets" then search for a partial/similar match on the score Sheet (which is NY JETS, in this case). NY JETS could be in column B (rangeB2:B257) OR column D (rangeD2:D257) BUT I need to search by row, not column, then once a match is found check the cell to the immediate right and only if the cell is blank copy data from the (!feed) sheet to that blank cell on the (!scores) sheet

This is what happens if working right =

look at cell A3 on the (!feed) sheet = "New York Jets" then search (!scores) sheet Column B and Column D by row for a partial match, finds "NY JETS" as match in cell D8, if cell E8 is blank then copies cell H3 from (!feed) sheet, and pastes to cell E8 on the (!scores) sheet, if cell is not blank continues search until 1st blank cell to the right of matching cell is found (as there will be mutiple matching cells with blank cells to the right but I am only interested in the 1st blank cell found, once found and data copied the process is done and then starts over with cell A4)

Look at cell A4 (!feed)= "New England Patriots" then search (!scores) sheet Column B and Column D by row, finds "NEW ENGLAND" as match in cell B8, if cell C8 is blank then copies cell H4 (!feed) sheet, and paste to cell C8 (!scores)

Once this is done it moves on to the next cell in the next row on the (!feed) sheet, A5, to find a partial match for the data in that cell. I need to continue the search for each cell A3 to A74, and if no match is found to move on to the next cell A6... (based on the way the data is pulled in from the web there are some blank cells as well as some cells that say Game Final, this data won't be on the scores sheets in column B or D).

View 1 Replies View Related

Nested IF (index And Match): Calculate A Charge In Cell K15 Based On Values In B9 And C10 Referencing The Table I8:R9

Jan 21, 2010

I'm trying to hone a quoting tool to generate an amount based on a given range and minimum charges for specified subsects of the range. If you reference the attachment I'm trying to calculate a charge in cell K15 based on values in B9 and C10 referencing the table I8:R9. What I cant figure out is how to create a minimum charge of 50 for J8:P9 (points A-G) and a charge of 95 for Q8:R9 (points H-I).

View 2 Replies View Related

Excel 2010 :: How To Filter / Sort Data Based On Partial Match Of Data In Cell

Apr 16, 2013

I am using Excel 2010. I am a novice user.

I have a lot of data to filter / sort. I want to initially to create a filter for a column of data - which has the format similar to hierarchical paths to files. The data is a mix of text/numbers. e.g.

pathA/path_X/path_Y/path_Z/lso0_rxs_reg_254__5_0/d
pathA/path_X/path_Y/path_Z/lso0_rxs_reg_253__5_0/d
pathA/path_123/path_456/data_out_reg_17_0/d
pathA/path_123/path_456/data_out_reg_0_0/d
pathA/path_X/path_Y/path_Z/lso0_rxs_reg_255__5_0/d

[Code] .........

Doing an alphabetical sort of this date would return the following order. As you can see while each strings in unique - there are many instances where they are simialr - if you ignore the unique numeric values at the end of the string.

pathA/path_123/path_456/data_out_reg_0_0/d
pathA/path_123/path_456/data_out_reg_17_0/d
pathA/path_123/path_456/data_out_reg_4_0/d
pathA/path_X/path_Y/path_Z/lso0_rxs_reg_230__6_0/d

[Code] ......

So what I want to do is to create a filter for the strings - but ignoring the numeric bits at the end i.e.

reg_[0-9]+_+[0-9]+/d

The strings are obviiously of varying length and the number of hierarchical paths is different, so I can't split string on "/".

Similarly folder paths names can contain "_" so can't split string on this either.

As I don't know how many "/" or "-" instances there will be in the string I don't believe I can use the find function. Also as the amount of number will be different i don't think I can use =right(a1,X) either.

I may be able to search for the pattern above - as this is probabay unique - so maybe it's something like the following pseudo code:

Function GetString(txt As String) As String
With CreateObject("VBScript.RegExp")
.Pattern = "reg_d+(_)+d+//d"
GetString = .execute(txt)(0)
End With
End Function

If I do require VBA code - how do I then use this for creating a column filter? Or will I have to extract the filtered data first from the column (and its associated row data) into another worksheet to use?

Once I have the filter in place I want to create tables using the filtered data - so for example each column value above has a lot of associated data values in each row e.g

26 pathA/path_123/path_456/data_out_reg_0_0/d
32 pathA/path_123/path_456/data_out_reg_17_0/d
8 pathA/path_123/path_456/data_out_reg_4_0/d

So my table would show the name "data_out_reg" and the range of values 8-32

View 1 Replies View Related

API To Get Username

May 29, 2008

I have Timesheet workbooks with 3 levels of access (user, viewer & me as developer).

I want use the GetuserName API function (with If/Then) to auto open the wkbk if I am loged in under my network login so psuecode looks bit like this

If network user is me then open wkbk
else ask for username & password

I have googled & searched the forum & the closest I have is this

Public Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function ReturnUserName() As String
' returns the NT Domain User Name
Dim rString As String * 255, sLen As Long, tString As String
tString = ""
On Error Resume Next...............

View 9 Replies View Related

Get UserName Or Log In Name

Nov 10, 2006

I've got a sheet with a "Last Edited By:" field and I want this to be populated with the current users name i.e. I suppose I mean the user name that is assigned to Excel, as opposed to the XP log in... although I guess either would do. I'm OK on the change event thing, but just dont know the function to find the the current users name.

View 3 Replies View Related

Insert Username Using VBA

Jan 17, 2007

I'm trying to use the code listed below on the works shared drive. When I open up the worksheet and save it, my log on identity is left as required in Cell B2 etc.. When someone else uses the sheet it just leaves the company name in this cell and not their log on identity? The date & time function always works ok. Can anyone advise me if what I'm after is achievable.

The code I've used below was used from a previous string on a similar question.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Now()
Range("A" & Rows.Count).End(xlUp).Offset(0, 1).Value = Application.UserName
End Sub[/b]

View 9 Replies View Related

Macro To Get Username

Jun 29, 2007

I have copied a macro off another board that get the username of the computer where the excel file is opened. It works fine on my pc but when I have sent the workbook to a colleague my username came up when he opened it. Also what I am trying to do is to modify the macro that does a vlookup on a range in worksheet 1 from where it picks name and surname (and transpose it onto worksheet 2 on cell A2), email (on B2), tel number (on C2) etc etc.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved