+ Reply to Thread
Results 1 to 2 of 2

MS Query - Case Statements, Excel Data file

  1. #1
    Registered User
    Join Date
    04-23-2009
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    6

    MS Query - Case Statements, Excel Data file

    I know that for MS Access, Case statements won't work. Does anyone know if they work when using an Excel file as the data source?

    Or maybe it's just my formatting is wrong. I've attached a sample of the data file, and the code I'm using is below:

    Please Login or Register  to view this content.
    Basically, if the Author field indicates me, then I know I commented. Otherwise, I know I need to comment.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: MS Query - Case Statements, Excel Data file

    hi,

    Yes, Case statements can work in Excel's VBA code but the syntax differs - check out the examples in http://www.ozgrid.com/VBA/select-case.htm
    However, I think you could achieve the same thing without resorting to code... highlight the cells in the author column & apply Conditional Formatting [alt + O + D], select "cell value is" & "not equal to" & type "me" in the dropdown, then click on Format & choose a colour.

    hmmm...
    The more I look at your post alongside its title, the more I think I've misunderstood & given a poor answer above, so I'll try again...

    You may find something of use at the below links but I hope with this "bump" that someone more knowledgeable will be able to give you a definitive answer.
    http://help.lockergnome.com/office/M...ict754381.html (see pbbellri's last post)

    http://www.advanced-excel.com/import_data.html

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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