Consulting

Results 1 to 4 of 4

Thread: Syntax error

  1. #1

    Syntax error

     
    
    If Workbooks("bbca_mgt_report_wip.xls").Worksheets("Vol").Columns("B").Values = Workbooks("BBCA volume report 2010_may_team").Worksheets("Agency 2010").Columns("A:B").Values Then
    MsgBox ("yes")
    Else
    MsgBox ("no")
    End If
    Can anyone help me solve the error of the sentence in bold? Appreciate all helps.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try Value not Values.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    I tried value and received an error "type mismatch".

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Just noticed you have columns not Range. You cannoty check all the values in a column like that.

    What exactly are you trying to do?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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