how can i unprotect a worksheet (password ABC ) copy last cell in collum a to a new worksheet and copy a row of data back to original sheet and password on closing file
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
worksheet unprotect (office2002 widowsxp)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » worksheet unprotect (office2002 widowsxp)
- This topic has 8 replies, 4 voices, and was last updated 19 years, 10 months ago.
AuthorTopicWSalexanderd
AskWoody LoungerJuly 10, 2005 at 7:49 am #421677Viewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerJuly 10, 2005 at 8:57 am #958882By “a new worksheet”, do you really mean that you want to create a new blank sheet, or do you mean an already existing sheet?
Where should the last (populated) cell in column A be copied to in the “new” sheet?
You say “copy a row of data back to original sheet”. Where does this row come from and where should it be copied in the original sheet? -
WSalexanderd
AskWoody LoungerJuly 10, 2005 at 11:35 am #958890i have a form on workbook “B” which opens workbook “A” which is protected with a password. i would like to open workbook “A” transfere the last cell in colum “A” to cell “A1” in Workbook “B”. the value of cell “A1” + 1 is then placed in cell “A2” and the row (2:2) copied back to last cell in colum “A” +1 in workbook “A”.
the workbook is then closed and the password re-instated. i am using worksheet 1 in both workbooks -
WSsdckapr
AskWoody LoungerJuly 10, 2005 at 6:10 pm #958941Does this do what you want
Option Explicit Sub AlexanderDCode() Dim wkbA As Workbook Dim wksA As Worksheet Dim wksB As Worksheet Set wksB = ThisWorkbook.Worksheets("Sheet1") Set wkbA = Workbooks.Open("c:Workbook A.xls") Set wksA = wkbA.Worksheets("Sheet1") wksA.Unprotect ("ABC") With wksB .Range("A1") = wksA.Range("A65536").End(xlUp) .Range("a2") = .Range("A1") + 1 .Rows("2:2").Copy _ wksA.Range("A65536").End(xlUp).Offset(1, 0) End With wksA.Protect ("ABC") wkbA.Close (True) Set wkbA = Nothing Set wksA = Nothing Set wksB = Nothing End Sub
I assumed the code is in workbookB. Be sure to change workbook name and path and worksheet names as appropriate.
Steve
-
WSalexanderd
AskWoody Lounger -
WSRudi
AskWoody LoungerJuly 11, 2005 at 6:08 am #959026 -
WSalexanderd
AskWoody LoungerJuly 11, 2005 at 7:45 pm #959169Superfluous empty lines removed by HansV
as you will see my way is with the two files in the same folder which works A OK for me, may be my pears could inprove on it
****************************************************************************************************************************************
Private Sub ABCDEF()
Dim Wkb As Workbook
Dim wksheet As Worksheet
Dim Path As String
Dim FName As String
Dim Pass As String
Dim Str As String
Dim LastRow As Long
Sheets(“Sheet1”).Select
Path = ThisWorkbook.Path
FName = “A.xls”
Pass = “ABC”
Sheet1.Unprotect Password:=”ABC”
Set Wkb = Workbooks.Open(Filename:=Path & “” & FName, Password:=Path)
If ActiveSheet.ProtectContents = True Then
ActiveSheet.Unprotect “ABC”
LastRow = Wkb.Sheets(1).Range(“A65536”).End(xlUp).Row
Windows(“3aSparePartsrequestAok.xls”).Activate
Wkb.Sheets(1).Range(“A” & LastRow).Copy Destination:=Range(“A2”) ‘??Paste Location Here??
ThisWorkbook.Sheets(1).Range(“A2”).EntireRow.Copy Destination:=Wkb.Sheets(1).Range(“A” & LastRow + 1)
Windows(“3aSparePartsrequestAok.xls”).Activate
Range(“A2”).Select
Range(“A3”).Value = Range(“A2”).Value + 1
Range(“A2:A3”).Select
Selection.NumberFormat = “0”
Range(“A3”).Select
Rows(“3:3”).Select
Selection.Copy
Windows(“A.xls”).Activate
Range(“A65536”).End(xlUp).Select
ActiveSheet.Paste
Range(“A2”).Select
End If
Application.DisplayAlerts = False
ActiveSheet.Protect “ABC”
ActiveWorkbook.Save
Wkb.Close
Application.DisplayAlerts = True
Windows(“3aSparePartsrequestAok.xls”).Activate
End Sub
******************************************************************************
for all who answered my call for help THANK YOU. if my my method is of use to any one be my guest -
WSHansV
AskWoody LoungerJuly 11, 2005 at 8:24 pm #959177Bananas are far more popular these days than pears…
Added – on the other hand, post 498067
-
WSRudi
AskWoody Lounger
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
2 hours, 32 minutes ago -
Out of band for Windows 10
by
Susan Bradley
4 hours, 5 minutes ago -
Giving UniGetUi a test run.
by
RetiredGeek
11 hours, 2 minutes ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
18 hours, 39 minutes ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
16 hours, 38 minutes ago -
Auto Time Zone Adjustment
by
wadeer
23 hours, 8 minutes ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
20 hours, 48 minutes ago -
Manage your browsing experience with Edge
by
Mary Branscombe
1 hour, 24 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
12 hours, 20 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
16 hours, 37 minutes ago -
Apps included with macOS
by
Will Fastie
16 hours, 15 minutes ago -
Xfinity home internet
by
MrJimPhelps
16 hours, 10 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
16 hours, 8 minutes ago -
Debian 12.11 released
by
Alex5723
1 day, 20 hours ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
1 day, 23 hours ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
1 day, 3 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
19 hours, 49 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
2 days, 16 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
2 days, 7 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
5 hours ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
2 days, 11 hours ago -
Some advice for managing my wireless internet gateway
by
LHiggins
1 day, 19 hours ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
21 hours, 20 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
3 days, 5 hours ago -
Sometimes I wonder about these bots
by
Susan Bradley
17 hours, 9 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
2 days, 15 hours ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
3 days, 19 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
2 days, 2 hours ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
1 day, 15 hours ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
3 days, 21 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.