Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default is this possible, replacing password protected sheet text with mac

I am using Excel 2003 and have a file where there are 175 sheets, each sheet
is used to collect data for different project - but the same format is used
in each sheet to collect data, only difference between those sheet is 'Name
of Sheet' which is 1, 2, 3, 4 upto 175.

All those sheets are password protected using DataToolsprotect sheet option
and my pass word is "project"

my problem is that by mistake i have written in cell $I$43 "Start Date" -
instead of this there should be "Amount" so i have to change this in all 175
sheet. For this i have to unprotect the sheet first and then type the text
and protect the sheet again. which is a time consuming process.

Can any one help me with a macro which can do this task ( in all 175 sheet
in cell $I$43 in place of text "Start Date" replace by "Amount" and keep the
sheet password protected) .

Thanx in advance

Rajat

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default is this possible, replacing password protected sheet text with mac

Sub unpro()
Dim w As Worksheet
For Each w In Worksheets
w.Unprotect ("project")
Range("$I$43").Value = "Amount"
w.protect Password:="project"
Next
End Sub

Mike F

"Rajat" wrote in message
...
I am using Excel 2003 and have a file where there are 175 sheets, each
sheet
is used to collect data for different project - but the same format is
used
in each sheet to collect data, only difference between those sheet is
'Name
of Sheet' which is 1, 2, 3, 4 upto 175.

All those sheets are password protected using DataToolsprotect sheet
option
and my pass word is "project"

my problem is that by mistake i have written in cell $I$43 "Start Date" -
instead of this there should be "Amount" so i have to change this in all
175
sheet. For this i have to unprotect the sheet first and then type the text
and protect the sheet again. which is a time consuming process.

Can any one help me with a macro which can do this task ( in all 175 sheet
in cell $I$43 in place of text "Start Date" replace by "Amount" and keep
the
sheet password protected) .

Thanx in advance

Rajat



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default is this possible, replacing password protected sheet text with

Dear Mike Fogleman

thanks for the quick reply, the code did not work properly
i have pasted the code in the module of VBA using Insert Module but the
problem is when i run the macro it give this error -

Run-time error '1004'
Application-defined or object-defined error
and provide 3 option "End" "Debug" "Help"

but i noticed that the cell value on the active sheet is changed to "Amount".
have i done any mistake in pasting the code in VBA?

I hope you can rectify the proble with this explanation.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default is this possible, replacing password protected sheet text with

Try this modified version of Mike's code:

Option Explicit

Sub unpro()
Dim w As Worksheet
For Each w In Worksheets
w.Unprotect "project"
w.Range("I43").Value = "Amount"
w.Protect Password:="project"
Next
End Sub

Notice that there's a "w." in front of range("I43"). Without that "w.", then
range("I43") refers to the currently activesheet.

Rajat wrote:

Dear Mike Fogleman

thanks for the quick reply, the code did not work properly
i have pasted the code in the module of VBA using Insert Module but the
problem is when i run the macro it give this error -

Run-time error '1004'
Application-defined or object-defined error
and provide 3 option "End" "Debug" "Help"

but i noticed that the cell value on the active sheet is changed to "Amount".
have i done any mistake in pasting the code in VBA?

I hope you can rectify the proble with this explanation.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default is this possible, replacing password protected sheet text with

thanks Dave :)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default is this possible, replacing password protected sheet text with

Yeah, thanks Dave. I wasn't completely awake yet.
"Rajat" wrote in message
...
thanks Dave :)



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing a password protected file. JEV Excel Discussion (Misc queries) 1 March 26th 09 01:08 PM
no password for protected sheet TJaques Excel Worksheet Functions 3 July 27th 06 05:51 PM
Importing from Password Protected Sheet workerboy Excel Worksheet Functions 0 June 5th 06 08:20 PM
password protected Sheet thrava Excel Discussion (Misc queries) 4 December 29th 04 07:54 PM
VBa, Password protected sheet fails to get unprotected with the same password Hans Rattink Excel Programming 3 July 28th 03 02:30 PM


All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"