Results 1 to 5 of 5

Thread: Excel macro betweek 2 books

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    11

    Exclamation Excel macro betweek 2 books

    Hi all,

    I am writing a macro to copy the data in a cell in 1 excell book (book1) to another (book2)

    the cell in book1 displays an answer to a formula that takes information from other cells in the book. all i want displayed in book2 is the answer that the formula in book1 gives. the problem i am comming across is that when i paste into the other book (book2) it gives me an error because it is trying to do the sum in the formula and the information is not in the cells in book2, there in book1. so basicly i only want the answer (displayed in the cell on book1) on book 2.

    Can any1 help me with this as its consumed most of my morning at work lol

    Thanks all

    Mark

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Excel macro betweek 2 books

    Code : pasteSpecial <--- look at the help file on this in the vba editor.
    You need to use special values.

    the alternative is to record yourself doing the copy and paste, then look at the code amd tweak as you need to.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    11

    Re: Excel macro betweek 2 books

    thanks, i have tried recording it already and then customising the rest of the code but i still get the errors even when using a paste special. will try using the help files and will get back to u

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    11

    Re: Excel macro betweek 2 books

    unfortunatly still no luck with it. is any1 able to give me a code example

  5. #5
    Junior Member
    Join Date
    Jun 2006
    Location
    Winnipeg, Manitoba
    Posts
    21

    Re: Excel macro betweek 2 books

    Perhaps I am not understanding the full gravity of your project, but if all you want to do is show the value of the a cell from another book, couldn't you just type '=' in the cell and then the cell you want to copy from? This works even from another book, and if you need it to be more dynamic, certainly you could code in the reference to the other cell?

    ='[Sales Activity.xls]Sheet1'!$I$14

Posting Permissions

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



Click Here to Expand Forum to Full Width