+ Reply to Thread
Results 1 to 2 of 2

"Ghost" values when pasting via VBA

  1. #1
    Forum Contributor
    Join Date
    04-13-2010
    Location
    England
    MS-Off Ver
    Office 2016 365
    Posts
    211

    "Ghost" values when pasting via VBA

    Hi,

    I'm writing a macro that does a copy and paste from a table to another workbook - this workbook is then used for a mail merge.

    Part of the macro also then saves what has been copied back to a history table. Which can then be used to track when/which batch records were last mailed.

    My problem. When do the paste back to the history table, then some kind of ghost value is coming across in blank cells in a column. Any formula that references this column immediately goes to a #Value error.

    If i manually select blank cells and hit DELETE - then the formulas right themselves. I've tried the following code. Including skipblanks set to true. As soon as this paste completes, my formulas go to #Value, how can i stop these "ghost" values (whatever they are) messing up my formulas?!

    Please Login or Register  to view this content.
    ' activate the workbook and copy the range

    Please Login or Register  to view this content.
    ' paste the range to the bottom the history table

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    04-13-2010
    Location
    England
    MS-Off Ver
    Office 2016 365
    Posts
    211

    Re: "Ghost" values when pasting via VBA

    In case anyone else comes across this thread - i evaluated the contents of the cells, right before the first copy by using the SpecialCells (xlCellTypeConstants) property and could see that excel was treating the blanks as being a constant - i don't know the reason why.

    Anyway, i re-jigged my formulas so i didn't have to paste these columns. But still don't know why excel pasted empty cells out of a table and thought they had some kind of value in.

    Thanks for looking anyway.

+ 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. [SOLVED] Pasting values between ranges in different workbooks: "Range" works but "Cells" doesn't
    By Flaubert in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2013, 01:19 PM
  2. Replies: 3
    Last Post: 02-16-2011, 02:55 PM
  3. [SOLVED] MAYDAY! Menus producing a "ghost" box rather than a drop down list
    By The Horny Goat in forum Excel General
    Replies: 2
    Last Post: 06-23-2006, 08:00 PM
  4. [SOLVED] "Ghost" sheet objects returned while using Excel.Application
    By mjohnson in forum Excel General
    Replies: 1
    Last Post: 01-27-2005, 10:06 AM
  5. Deleting "ghost" copies of workbook?
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2005, 05:22 PM

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