Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2007
    Posts
    88

    Unanswered: Access VBA Excel cells copy the formula or link not the value! Help!

    Hi Gurus,

    I wrote some access vba code to copy some cells from one excel workbook to another workbook. Those Cells either have links to other worksheet or have some formula. I want the displayed numeric values in the cells copied to another workbook. However, it did not do the result I want, it copied the links or formula and created weird results. Would you please let me know how to copy the values only? Thanks so much!

    newguy

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Quote Originally Posted by newguyinaccess
    Hi Gurus,

    I wrote some access vba code to copy some cells from one excel workbook to another workbook. Those Cells either have links to other worksheet or have some formula. I want the displayed numeric values in the cells copied to another workbook. However, it did not do the result I want, it copied the links or formula and created weird results. Would you please let me know how to copy the values only? Thanks so much!

    newguy
    Hi

    If its just the Values you want then perhaps you need something like this (suitable modified to suit your particular Excel Auotomated object(s) references etc.)
    Code:
        With XLApp
            .Range("F2").Copy
            .Range("G3").PasteSpecial Paste:=xlPasteValues
        End With
    ??

    MTB

  3. #3
    Join Date
    Aug 2007
    Posts
    88

    That works!

    Thank you so much! That works great!

    newguy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •