+ Reply to Thread
Results 1 to 2 of 2

Copy empty cells from one workbook to another - Code

  1. #1
    David Choen
    Guest

    Copy empty cells from one workbook to another - Code

    Hello,

    Sorry for posting 2 times. Date & time in my computer were not correctly
    set.

    In addition to what I've written before, here is the code I wrote:

    Sub Dataacquire()
    Workbooks.Open "data.xls"
    Worksheets("sheet1").Range("b1:d19").Copy _
    ThisWorkbook.Worksheets("sheet1").Range("b1:d19")
    ActiveWorkbook.Close SaveChanges:=False
    End Sub

    My problem that empty cells are not copied as empty and
    because of this I get an error messages in other worksheets (like #VALUE).

    How Can I solve this problem ?

    Thank you
    David Cohen








  2. #2
    Dave Peterson
    Guest

    Re: Copy empty cells from one workbook to another - Code

    What are in those cells? Maybe they're not really empty--maybe they're formulas
    that evaluate to "".

    If they're formulas, maybe when you paste them to the new location, they point
    to cells that break the formula:

    Say B1 contained =if(a1*2=4,"","ok")

    And if you paste that into a worksheet that has "hi there" in A1.

    (copy and paste special|values might be an alternative)



    David Choen wrote:
    >
    > Hello,
    >
    > Sorry for posting 2 times. Date & time in my computer were not correctly
    > set.
    >
    > In addition to what I've written before, here is the code I wrote:
    >
    > Sub Dataacquire()
    > Workbooks.Open "data.xls"
    > Worksheets("sheet1").Range("b1:d19").Copy _
    > ThisWorkbook.Worksheets("sheet1").Range("b1:d19")
    > ActiveWorkbook.Close SaveChanges:=False
    > End Sub
    >
    > My problem that empty cells are not copied as empty and
    > because of this I get an error messages in other worksheets (like #VALUE).
    >
    > How Can I solve this problem ?
    >
    > Thank you
    > David Cohen


    --

    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