+ Reply to Thread
Results 1 to 3 of 3

Null, "null", vbNull, vbNullString, vbEmpty

  1. #1

    Null, "null", vbNull, vbNullString, vbEmpty

    Hi,

    if I am writing VBA code in MS EXCEL to insert 'nulls' into certain
    cells,
    so that when I import that into MS Access I can run queries with the
    filter criteria such as

    SELECT *
    FROM blah
    WHERE column Is Not Null

    Then which Null do i use?

    cell.Value = Null ?
    cell.Value = "Null" ?
    cell.Value = vbNull ?
    cell.Value = vbNullString ?
    cell.Value = vbEmpty ?


    I'm all nulled crazy ...hehe.


  2. #2
    Harald Staff
    Guest

    Re: Null, "null", vbNull, vbNullString, vbEmpty

    Excel cells can't afaik contain NULL. They will be either zero or an empty
    string (which behaves like zero in Excel's calculations).

    HTH. Best wishes Harald

    <[email protected]> skrev i melding
    news:[email protected]...
    > Hi,
    >
    > if I am writing VBA code in MS EXCEL to insert 'nulls' into certain
    > cells,
    > so that when I import that into MS Access I can run queries with the
    > filter criteria such as
    >
    > SELECT *
    > FROM blah
    > WHERE column Is Not Null
    >
    > Then which Null do i use?
    >
    > cell.Value = Null ?
    > cell.Value = "Null" ?
    > cell.Value = vbNull ?
    > cell.Value = vbNullString ?
    > cell.Value = vbEmpty ?
    >
    >
    > I'm all nulled crazy ...hehe.
    >




  3. #3
    Dave Peterson
    Guest

    Re: Null, "null", vbNull, vbNullString, vbEmpty

    I don't speak the Access or the SQL, but in VBA these are almost equivalent:

    cell.value = ""
    cell.clearcontents

    About the only time I've noticed a difference is when I'm dealing with merged
    cells (yech!!!).



    [email protected] wrote:
    >
    > Hi,
    >
    > if I am writing VBA code in MS EXCEL to insert 'nulls' into certain
    > cells,
    > so that when I import that into MS Access I can run queries with the
    > filter criteria such as
    >
    > SELECT *
    > FROM blah
    > WHERE column Is Not Null
    >
    > Then which Null do i use?
    >
    > cell.Value = Null ?
    > cell.Value = "Null" ?
    > cell.Value = vbNull ?
    > cell.Value = vbNullString ?
    > cell.Value = vbEmpty ?
    >
    > I'm all nulled crazy ...hehe.


    --

    Dave Peterson

+ Reply to Thread

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