+ Reply to Thread
Results 1 to 7 of 7

Copy and pasting from a user defined function.

  1. #1
    Registered User
    Join Date
    04-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    9

    Copy and pasting from a user defined function.

    Hi all,

    First post, hopefully it will be an easy one for you lot.

    I have created a vba user defined function which performs a calculation. I would like to copy the end result of the calculation in the function to be copied to a cell that is two rows down from the cell which performs the function. I don't think this is possible but thought I would ask the question anyways.

    I have enclosed a document, the function in the vb is labelled as copypaste and I would like to paste the copypaste value which is 2, from the activecell to two rows below. This should work exactly the same should I put the function into any other cell.

    Appreciate your feedback.

    JaysonCopypastefromfunction.xlsm

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Copy and pasting from a user defined function.

    functions can't do that (not entirely true-they can but it's a really bad idea)

    why can't you put the function in the cell you want the value in?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    04-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Copy and pasting from a user defined function.

    Didn't think so!! I require part of the calculation in the function to be copy and pasted into a spreadsheet together with the end result of the function, so we can see one part of the calculation as a value. The alternative is to break the function up into the calculations I require, however I was hoping I could get this all in one function.

    Many thanks for your response.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Copy and pasting from a user defined function.

    you could have the function return an array of values one of which is the intermediate calculation?

  5. #5
    Registered User
    Join Date
    04-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Copy and pasting from a user defined function.

    How do I do that?

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Copy and pasting from a user defined function.

    Please Login or Register  to view this content.
    for instance

  7. #7
    Registered User
    Join Date
    04-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Copy and pasting from a user defined function.

    Thanks for this I will give it a try!!

+ 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