Password protecting different pricing for different users

deilert

New Member
Joined
Jul 20, 2007
Messages
9
Folks,

I have a spreadsheet with lots of parts and quantities that I'd like to discuss with two different parties (A and B), however I have two different pricing with both parties. I'd like to be able to chat with both of them at the same time to work toward the right quantities, but I'd rather not reveal pricing (keep the columns and rows hidden.) I would like both parties to be able to independently "enable" their respective pricing to be shown on the spreadsheet through a password. This way I don't have to continue to maintain multiple versions of the file. Both parties are respectful of not sharing the pricing with each other.

I've created a very simplified version I what I'm discussing below. I have the two pricing lookups in different tabs however.


Excel 2010
ABCDEF
1PriceTotalStoreStoreStore
2ItemAQtyABC
3Apples$ 1.003520105
4Oranges$ 1.50151050
5Peaches$ 2.2535151010
6Limes$ 0.50205510
7Total Qty105503025
8Total Price$ 146.25$ 71.25$ 42.50$ 32.50
9
10
11Price APrice B
12ItemPriceItemPrice
13Apples$ 1.00Apples$ 1.25
14Oranges$ 1.50Oranges$ 1.75
15Peaches$ 2.25Peaches$ 2.00
16Limes$ 0.50Limes$ 0.25
Totals




Thanks

Daren
 
Sorry I didn't reply yesterday, but here ya go. So you'll have to update the range in HideData() to include every cell you used, and if you want to manually unprotect the sheet the password would be: secret.

Rich (BB code):
' Hides all pricing information
Sub HideData()


'Unlock all (update range as necessary)
    Worksheets("Totals").Unprotect Password = "secret"
    Worksheets("Totals").Range("A1:Z99").Locked = False
    
'Lock and hide A
    Worksheets("PriceA").Visible = False
    
    Worksheets("Totals").Columns("B").EntireColumn.Hidden = True
    Worksheets("Totals").Rows("8").EntireRow.Hidden = True
    
    Worksheets("Totals").Columns("B").Locked = True
    Worksheets("Totals").Rows("8").Locked = True
    
'Lock and hide B
    Worksheets("PriceB").Visible = False
    
    Worksheets("Totals").Rows("9").EntireRow.Hidden = True
    Worksheets("Totals").Columns("C").EntireColumn.Hidden = True
    
    Worksheets("Totals").Rows("9").Locked = True
    Worksheets("Totals").Columns("C").Locked = True
    
'Protect Sheet
    Worksheets("Totals").Protect Password = "secret"

End Sub


' Shows selective pricing sheets, columns, and rows based upon password Sub ShowData() 'Group specific password otherpass = InputBox("Please Enter A Password To Show Pricing") 'Unlock and unhide A If otherpass = "aPassword" Then Worksheets("Totals").Unprotect Password = "secret" Worksheets("PriceA").Visible = True Worksheets("Totals").Columns("B").Locked = False Worksheets("Totals").Rows("8").Locked = False Worksheets("Totals").Columns("B").EntireColumn.Hidden = False Worksheets("Totals").Rows("8").EntireRow.Hidden = False Worksheets("Totals").Protect Password = "secret" 'Unlock and unhide B ElseIf otherpass = "bPassword" Then Worksheets("Totals").Unprotect Password = "secret" Worksheets("PriceB").Visible = True Worksheets("Totals").Rows("9").Locked = False Worksheets("Totals").Columns("C").Locked = False Worksheets("Totals").Rows("9").EntireRow.Hidden = False Worksheets("Totals").Columns("C").EntireColumn.Hidden = False Worksheets("Totals").Protect Password = "secret" Else MsgBox ("Not a valid password") End If End Sub
 
Last edited:
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

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