Results 1 to 4 of 4

Compile Error Expected: End of statement

Threaded View

AKarmyguy Compile Error Expected: End... 05-03-2010, 01:22 AM
abrownin Re: Compile Error Expected:... 05-03-2010, 01:42 AM
abrownin Re: Compile Error Expected:... 05-03-2010, 01:49 AM
royUK Re: Compile Error Expected:... 05-03-2010, 02:20 AM
  1. #1
    Registered User
    Join Date
    05-03-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Cool Compile Error Expected: End of statement

    OK so here is what I am trying to do,

    I have the below macro or VBA what ever you call it so that users no where to input text and data in a form and then when they click print it will hide the background color this is the code I am using but it keeps telling me
    Compile Error:
    Expected: End of statement.

    What am I doing wrong?

    Private Sub Change background color to Grey for cells listed
    Range ("C6,C7,C8,E8,F8,C9,C10,C11,C12,C13,C14,B16,G16,L16,C17,C18,G18,I18,L18,L19L20,L21,L22,L23,L24,C19,G19,I19,C20,C21,C22,C23,C24,C25,G25,I5,I6,I7,K28,K29,K30,K31,K32,O28,O29,F32,F33,A37,A38,A39,A40,A41,A42,A43,A44,A45, D37,D38,D39,D40,D41,D42,D43,D44,D45,I37,I38,I39,I40,I41,I42,I43,I44,I45, K37,K38,K39,K40,K41,K42,K43,K44,K45, L37,L38,L39,L40,L41,L42,L43,L44,L45,N46,P46") - Interior - ColorIndex = 16
    ' Change background color to default (White) for cells listed Range ("C6,C7,C8,E8,F8,C9,C10,C11,C12,C13,C14,B16,G16,L16,C17,C18,G18,I18,L18,L19L20,L21,L22,L23,L24,C19,G19,I19,C20,C21,C22,C23,C24,C25,G25,I5,I6,I7,K28,K29,K30,K31,K32,O28,O29,F32,F33,A37,A38,A39,A40,A41,A42,A43,A44,A45, D37,D38,D39,D40,D41,D42,D43,D44,D45,I37,I38,I39,I40,I41,I42,I43,I44,I45, K37,K38,K39,K40,K41,K42,K43,K44,K45, L37,L38,L39,L40,L41,L42,L43,L44,L45,N46,P46") - Interior-ColorIndex = 2
    End Sub
    Last edited by AKarmyguy; 05-03-2010 at 02:48 AM. Reason: add code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1