Display different rows for different users

Lesjoan01

New Member
Joined
Mar 29, 2017
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have a master spreadsheet that contains information provided by various users. At the moment each user sends an update and then this is manually copied into the master spreadsheet.

My question/query is:
Can I set up my spreadsheet so that when the user opens it they only see the cells/information that are relevant to them. They then update the risks that are assigned to them and send it back to me, this in turn updates the master spreadsheet.

I have seen articles that suggest using VBA or Power Query but I do not know where to start.

Example spreadsheet (master)

RiskUpdateOwner
Risk1Update 1Owner 1
Risk2Update 2Owner 1
Risk3Update 3Owner 2
Risk4Update 4Owner 2
Risk5Udpate 5Owner 3
Risk6Update 6Owner 3
Risk7Update 7Owner 4
Risk8Udpate 8Owner 4
Risk9Update 9Owner 5
Risk10Update 10Owner 5

Example spreadsheet (what Owner 1 would see)

RiskUpdateOwner
Risk1Update 1Owner 1
Risk2Update 2Owner 1

Thanks in anticipation of one of the many geniuses on here knowing the answer :)
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’). The newer version of Excel have some cool new functions that may simplify tasks like these.

Also, what exactly is in the "Owner" field?
Is it the network ID for each user?
If not, how is Excel supposed to know which user is opening the file, and how to tie that back to the values in the Owner column?
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’). The newer version of Excel have some cool new functions that may simplify tasks like these.

Also, what exactly is in the "Owner" field?
Is it the network ID for each user?
If not, how is Excel supposed to know which user is opening the file, and how to tie that back to the values in the Owner column?
Hi Joe4,

thanks for the tip re updating my details - I have done this.

We are using 365 on Windows.

The 'Owner' field would be a specific users name - at the moment it is just their name so may not necessarily be the actual network name - however, that could be changed so that the Excel knows who is opening the file.

Many thanks
Lesley
 
Upvote 0
One way is to do something like the following:

1. Set up filters on this data range/table.
2. Then put the following VBA code in the "ThisWorkbook" module of the VB Editor:
VBA Code:
Private Sub Workbook_Open()

    Dim rng As Range
    Dim owner As String

'   Specify sheet to apply this to
    Sheets("Sheet2").Activate
    
'   Assuming data starts in cell A1, set range
    Set rng = Range("A1").CurrentRegion
    
'   Prompt user for owner name
    owner = InputBox("Please enter your name")
    
'   Remove any old filers
    ActiveSheet.Range("$A$1:$C$11").AutoFilter Field:=3
    
'   Apply new filter
    ActiveSheet.Range("$A$1:$C$11").AutoFilter Field:=3, Criteria1:=owner _
        , Operator:=xlAnd
        
End Sub

*Note that you will need to update this line:
VBA Code:
    Sheets("Sheet2").Activate
to match the name of the sheet where this data resides.

Save the file and close it.

Now, whenever you open the file, it will prompt the user for their name and then apply that to the Owner filter in the third column.
Obviously, you can modify this, but it should at least give you a good point to start from.
 
Upvote 0
Solution
One way is to do something like the following:

1. Set up filters on this data range/table.
2. Then put the following VBA code in the "ThisWorkbook" module of the VB Editor:
VBA Code:
Private Sub Workbook_Open()

    Dim rng As Range
    Dim owner As String

'   Specify sheet to apply this to
    Sheets("Sheet2").Activate
   
'   Assuming data starts in cell A1, set range
    Set rng = Range("A1").CurrentRegion
   
'   Prompt user for owner name
    owner = InputBox("Please enter your name")
   
'   Remove any old filers
    ActiveSheet.Range("$A$1:$C$11").AutoFilter Field:=3
   
'   Apply new filter
    ActiveSheet.Range("$A$1:$C$11").AutoFilter Field:=3, Criteria1:=owner _
        , Operator:=xlAnd
       
End Sub

*Note that you will need to update this line:
VBA Code:
    Sheets("Sheet2").Activate
to match the name of the sheet where this data resides.

Save the file and close it.

Now, whenever you open the file, it will prompt the user for their name and then apply that to the Owner filter in the third column.
Obviously, you can modify this, but it should at least give you a good point to start from.
Hi Joe,
thank you so much for this. I will give that a go and let you know how I get on. Appreciate your assistance with this.
 
Upvote 0
You are welcome.
Hi Joe4,

just wanted to let you know that it worked (not that I had any doubts, more doubts around my ability to get it working!!!).

Again, thanks very much for your help with this.

Take care
Lesley
 
Upvote 0
Hi Joe4,

just wanted to let you know that it worked (not that I had any doubts, more doubts around my ability to get it working!!!).

Again, thanks very much for your help with this.

Take care
Lesley
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top