Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Run Time Error 1004: Please help

Option Explicit

Private Sub REmove_Net_Pricing_Info_Click()

' SelectButton Macro
' Macro recorded 2/20/2006 by JFS
' Delete TP Contract References to Pricing (Customer Copy),
' so it can be added to Trailer Contract
'
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.ProtectContents = True Then
ws.Unprotect ("Fern")
End If

Next
ActiveWorkbook.Unprotect (["Ferd"])

Sheets("Options").Select
Range("C6").Select
Selection.ClearContents
Range("H6:I6").Select
Selection.ClearContents

Sheets("Pricing").Select
Range("C120").Select
Selection.ClearContents
Range("C121").Select
Selection.ClearContents

Sheets("Contract").Select
Range("B1").Select

If ws.ProtectContents = False Then
ws.Protect ("Fern")
End If

Application.ScreenUpdating = True

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run Time Error 1004: Please help

Option Explicit

Private Sub REmove_Net_Pricing_Info_Click()

' SelectButton Macro
' Macro recorded 2/20/2006 by JFS
' Delete TP Contract References to Pricing (Customer Copy),
' so it can be added to Trailer Contract
'
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.ProtectContents = True Then
ws.Unprotect ("Fern")
End If

Next
ActiveWorkbook.Unprotect (["Ferd"])

Sheets("Options").Select
Range("C6").Select
Selection.ClearContents
Range("H6:I6").Select
Selection.ClearContents

Sheets("Pricing").Select
Range("C120").Select
Selection.ClearContents
Range("C121").Select
Selection.ClearContents

Sheets("Contract").Select
Range("B1").Select

for each ws in ActiveWorkbook.Worksheets
If ws.ProtectContents = False Then
ws.Protect ("Fern")
End If
Next
Application.ScreenUpdating = True

End Sub

--
Regards,
Tom Ogilvy


"BEEJAY" wrote in message
...
Option Explicit

Private Sub REmove_Net_Pricing_Info_Click()

' SelectButton Macro
' Macro recorded 2/20/2006 by JFS
' Delete TP Contract References to Pricing (Customer Copy),
' so it can be added to Trailer Contract
'
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.ProtectContents = True Then
ws.Unprotect ("Fern")
End If

Next
ActiveWorkbook.Unprotect (["Ferd"])

Sheets("Options").Select
Range("C6").Select
Selection.ClearContents
Range("H6:I6").Select
Selection.ClearContents

Sheets("Pricing").Select
Range("C120").Select
Selection.ClearContents
Range("C121").Select
Selection.ClearContents

Sheets("Contract").Select
Range("B1").Select

If ws.ProtectContents = False Then
ws.Protect ("Fern")
End If

Application.ScreenUpdating = True

End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Run Time Error 1004: Please help

SORRY about the duplicate posting - please use other one - Thank you.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Run Time Error 1004: Please help

Thanks, Tom, for the prompt response.
Sorry this one got sent before I completed my comments
- I hit the right button at the wrong time, I guess.

I added your input to that received from the other post and got it going.
Thanks Again.
jfs

"Tom Ogilvy" wrote:

Option Explicit

Private Sub REmove_Net_Pricing_Info_Click()

' SelectButton Macro
' Macro recorded 2/20/2006 by JFS
' Delete TP Contract References to Pricing (Customer Copy),
' so it can be added to Trailer Contract
'
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.ProtectContents = True Then
ws.Unprotect ("Fern")
End If

Next
ActiveWorkbook.Unprotect (["Ferd"])

Sheets("Options").Select
Range("C6").Select
Selection.ClearContents
Range("H6:I6").Select
Selection.ClearContents

Sheets("Pricing").Select
Range("C120").Select
Selection.ClearContents
Range("C121").Select
Selection.ClearContents

Sheets("Contract").Select
Range("B1").Select

for each ws in ActiveWorkbook.Worksheets
If ws.ProtectContents = False Then
ws.Protect ("Fern")
End If
Next
Application.ScreenUpdating = True

End Sub

--
Regards,
Tom Ogilvy


"BEEJAY" wrote in message
...
Option Explicit

Private Sub REmove_Net_Pricing_Info_Click()

' SelectButton Macro
' Macro recorded 2/20/2006 by JFS
' Delete TP Contract References to Pricing (Customer Copy),
' so it can be added to Trailer Contract
'
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.ProtectContents = True Then
ws.Unprotect ("Fern")
End If

Next
ActiveWorkbook.Unprotect (["Ferd"])

Sheets("Options").Select
Range("C6").Select
Selection.ClearContents
Range("H6:I6").Select
Selection.ClearContents

Sheets("Pricing").Select
Range("C120").Select
Selection.ClearContents
Range("C121").Select
Selection.ClearContents

Sheets("Contract").Select
Range("B1").Select

If ws.ProtectContents = False Then
ws.Protect ("Fern")
End If

Application.ScreenUpdating = True

End Sub





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
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Run time error '1004': Generaol ODBC error Dwaine Horton[_3_] Excel Programming 2 April 26th 05 02:52 PM
Run time error 1004 General ODCB Error Kevin Excel Programming 3 February 26th 05 12:51 PM
Application Run Time Error 1004 and Stack Error ExcelMonkey[_190_] Excel Programming 9 February 11th 05 04:48 PM


All times are GMT +1. The time now is 02:53 PM.

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

About Us

"It's about Microsoft Excel"