ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protecting Sheet with Password (https://www.excelbanter.com/excel-programming/310076-protecting-sheet-password.html)

halem2[_20_]

Protecting Sheet with Password
 
Hi:

I have a sheet that I copy and past with a macro. The original shee
is protected with a password but when the macro copies and pastes int
another sheet, it is no longer protected.

Is there a way to pass a password to protect the new sheet???


thanks

--
Message posted from http://www.ExcelForum.com


Dave Peterson[_3_]

Protecting Sheet with Password
 
Couldn't you just password protect it after you did the paste?

Or do you mean you want to use the same password--and it's not available to you?



"halem2 <" wrote:

Hi:

I have a sheet that I copy and past with a macro. The original sheet
is protected with a password but when the macro copies and pastes into
another sheet, it is no longer protected.

Is there a way to pass a password to protect the new sheet???

thanks!

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson


halem2[_21_]

Protecting Sheet with Password
 
the spreadsheet will be used by 15 different users in 15 differen
geographical locations. I'm trying to avoid having any of them chang
the sheet. I am the one passwording the sheet

--
Message posted from http://www.ExcelForum.com


Dave Peterson[_3_]

Protecting Sheet with Password
 
If you're the one applying the password and writing the code, then you should be
able do your stuff and protect the worksheet.

dim wks1 as worksheet
dim wks2 as worksheet

set wks1 = worksheets("sheet1")
set wks2 = worksheets("sheet2")

wks1.range("a1:b9").copy _
destination:=wks2.range("a1")

wks2.protect password:="hi"

I guess you didn't even need to unprotect your original worksheet to copy the
data.

(I misunderstood that portion of your question.)





"halem2 <" wrote:

the spreadsheet will be used by 15 different users in 15 different
geographical locations. I'm trying to avoid having any of them change
the sheet. I am the one passwording the sheet.

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson



All times are GMT +1. The time now is 05:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com