+ Reply to Thread
Results 1 to 4 of 4

Syntax ERROR in Range

  1. #1
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Syntax ERROR in Range

    I have a SYNTAX Problem!
    I am trying to get a range ThisWorkbook.Worksheets("SheetName").Range("A8:H2000") But I can't seem to get it right 🙄
    Can someone please help 👍

    CODE:
    objRecordset.Open "Select * FROM [CustDb$]", objConnection
    Sheet2.Range("A2").CopyFromRecordset objRecordset

  2. #2
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Syntax ERROR in Range

    I Need the FROM [CustDb$] to be this Range:ThisWorkbook.Worksheets("SheetName").Range("A8:H2000")

    What does the $ mean?

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Syntax ERROR in Range

    Are you actually querying an Excel workbook?
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413
    Quote Originally Posted by Norie View Post
    Are you actually querying an Excel workbook?
    Rhanks for tour reply, I have got this part fixed.
    But now it dosent copy anything.
    Maybe you Will take a look at my post a bit further Up.
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Range.Insert Method ( Excel OOP Syntax Error )
    By JackSheet_1 in forum Tips and Tutorials
    Replies: 11
    Last Post: 04-25-2016, 10:38 AM
  2. [SOLVED] Set Range syntax - currently causing #value! error sometimes
    By kamelkid2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2014, 03:11 PM
  3. Out of range error Possible syntax error?
    By Rob K in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-02-2014, 06:30 AM
  4. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  5. [SOLVED] Error 1004: Application-defined or object-defined error on Range(Cells(x,y)) syntax
    By winch in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-04-2013, 11:02 AM
  6. Syntax error on trying to create a "Named range"
    By highlystrung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2011, 03:40 PM
  7. Syntax Error adding Date Picker to a range
    By B. Baumgartner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2007, 12:25 PM

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