+ Reply to Thread
Results 1 to 3 of 3

VBA function to change multiple cell values?

  1. #1
    Registered User
    Join Date
    06-22-2010
    Location
    Rochester
    MS-Off Ver
    Excel 2003
    Posts
    2

    VBA function to change multiple cell values?

    In each row of a spreadsheet, I need to simultaneously calculate three different values based on values in that row. A UDF seems like the proper way to go, something like =MYFunc(a,b,c). However, a function can only return a single value. I have "solved" my problem in an inelegant way, namely =MyFunc1(a,b,c), Myfunc2(a,b,c), Myfunc3(a,b,c), where each function is in its own column/cell. There must be a simpler way! To be clearer, the arguments a,b,c are not the values that are calculated by the function. I need to do this in multiple rows.
    Any suggestions are welcome. Thanks in advance.
    Last edited by Econdoc1; 06-23-2010 at 07:37 AM. Reason: Request by Forum manager

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Newbie VBA function question

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Newbie VBA function question

    You could return an array, something like

    Please Login or Register  to view this content.
    SO you select three cells, say M1,N1 and O1, enter =MyFunc() in the formula bar, and array enter it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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