Range text is RED

LTL1963

New Member
Joined
Dec 10, 2004
Messages
31
My Macro to print pages works to a point, I can print the first 50+ pages out of ~400 pages.
The range text in the VBA changes to red part way through the code and when I try to run it I get a Syntax Error that points to the red text range. Code below, BACK02_3() the range is fine, BACK03_3() the range text turned red.

Code:
Sub BACK02_3()
    ActiveSheet.Unprotect
    Range("EL200:GR258").Select
    Selection.Interior.ColorIndex = xlNone
    Range("EL200:GR258").Select
    Selection.PrintOut Copies:=1, Collate:=True
    With Selection.Interior
        .ColorIndex = 36
        .PatternColorIndex = xlAutomatic
    End With
    Range("EL200").Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Sub BACK03_3()
    ActiveSheet.Unprotect
    Range(“EL300:GR358").Select
    Selection.Interior.ColorIndex = xlNone
    Range(“EL300:GR358").Select
    Selection.PrintOut Copies:=1, Collate:=True
    With Selection.Interior
        .ColorIndex = 36
        .PatternColorIndex = xlAutomatic
    End With
    Range(“EL300").Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub


Thank-you for any help.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Some of your " were a strange character. Try

Code:
Sub BACK03_3()
    ActiveSheet.Unprotect
    Range("EL300:GR358").Select
    Selection.Interior.ColorIndex = xlNone
    Range("EL300:GR358").Select
    Selection.PrintOut Copies:=1, Collate:=True
    With Selection.Interior
        .ColorIndex = 36
        .PatternColorIndex = xlAutomatic
    End With
    Range("EL300").Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
 
Upvote 0
Thank-you both very much, I did all the typing in word since it was repetitive and did a search and replace on the ranges.
Then cut and pasted the programming back into the macro, thus the " getting me from word.

Your assistance is very much appreciated.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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