+ Reply to Thread
Results 1 to 4 of 4

Range of copied cells based on the range of a UDF array function

  1. #1
    Registered User
    Join Date
    10-30-2016
    Location
    New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    2

    Range of copied cells based on the range of a UDF array function

    It seems as if it should be easy, but I am stumped.
    I am trying to write an array UDF with one argument - a cell range. The function is supposed to copy a block of data indicated by the cell range which is the same size as the function array. For example, if =movecells(B3) is entered into the 5x3 array H4:J8, it returns the contents of the 5x3 block of cells with B3 at the top left. In other word, the function copies the values in cells B3:D7 over into into H4:J8.
    Any thoughts appreciated.
    Thanks, kat

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Range of copied cells based on the range of a UDF array function

    A UDF can only return values to the cell(s) it's entered in.

    UDF Rules
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Range of copied cells based on the range of a UDF array function

    Disregard the previous post. I misread the query.

    Quote Originally Posted by katxt View Post
    For example, if =movecells(B3) is entered into the 5x3 array H4:J8, it returns the contents of the 5x3 block of cells with B3 at the top left.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-30-2016
    Location
    New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Range of copied cells based on the range of a UDF array function

    Great. Perfect. Thanks. kat

+ 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] Countif Formula copied down where the range changes based on subgrouping
    By CHillFL in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-02-2015, 11:49 AM
  2. Highlighting range of cells based on an array if-statement (not using loops)
    By clabulis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-22-2014, 02:23 PM
  3. [SOLVED] Numbers copied from a Double Array to a Range.Value2 loses precision
    By TopXorGuy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-30-2012, 10:19 AM
  4. Function call returns actual code instead of copied range
    By rlg50 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-22-2012, 04:44 PM
  5. Slow macro due to formulae being copied in a range of cells
    By Themd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2009, 04:00 PM
  6. looking for an empty row to paste a range of copied cells
    By jayers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2009, 10:12 PM
  7. Replies: 2
    Last Post: 09-24-2005, 08:05 PM

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