+ Reply to Thread
Results 1 to 5 of 5

Trying to return data using array

  1. #1
    Registered User
    Join Date
    07-14-2013
    Location
    Grand Rapids, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    35

    Trying to return data using array

    So, I have this huge data set which has caused me to have to use arrays. I'm still a new and learning user, but I really do think this is the best solution for my problem. I have sheet one as my rollup sheet and sheets 2-5 have data on them representing quarterly numbers. My problem is figuring out how to offset the data one cell to the right of where the original data goes and I thought I had it figured out, but I think I need to define a dimension for one or all of the variables that represent where I want the data to go. I've tried just about everything, but I think I'm missing something simple, yet fundamental. When I put in a message box to return values for the cell variables I wish to drop data in, it returns the data that's already in there, and the offset works, but for some reason, that's all I can get it to do. It will not for the life (or death, if I cannot figure this out soon) of it put the sum'd values in those cells, just keeps looking at them and the data that's already in them. PLEASE HELP before I go insane! I'm going to put the last iteration of my code in here, but I have a simpler build which might be easier to look through to identify the problem, which I'll drop in below that. BUT I'M killing my sanity right now just trying to think about what I'm doing wrong. Below, I've included the code(s).

    Please Login or Register  to view this content.
    The simpler code set is as follows:

    Please Login or Register  to view this content.
    Last edited by Rokn; 05-21-2015 at 06:00 PM. Reason: Forgot one of the code sets

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,960

    Re: Trying to return data using array

    At the top of your code, you have:

    balCel = Sheet1.Range("Q3").Offset(0, rtrnOff), but you did not declare the variable balCel, so balCel is holding the value of the data in the cell at the offset from Q3.

    It seems that you are trying to use balCel (and the rest) as names (pointers) for cells. To do that you need to modify your code such as:
    Please Login or Register  to view this content.
    Then to write data to the cell:

    balCel.Value = rtrnBal
    Ben Van Johnson

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Trying to return data using array

    Hello Rokn,

    Help us to Help you...

    You should post a copy of your workbook for review. Please change or redact any information that is personal or confidential before you post.

    Please tell us in detail what results you expect and include before and after examples of your data.

    If you have any error messages, please include them in your post and mark the line in your code where the error occurred.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    07-14-2013
    Location
    Grand Rapids, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Trying to return data using array

    This worked great! I can't believe I hadn't thought of that. This got is just like I needed. You win my hero of the day award. THANK YOU, THANK YOU, THANK YOU! My sanity has officially been saved!

  5. #5
    Registered User
    Join Date
    07-14-2013
    Location
    Grand Rapids, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Trying to return data using array

    Yes, it's been a while since I've visited the forum, thank you for the reminders. I'll try to be more clear and include spreadsheet mock-ups in the future.

+ 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. Replies: 0
    Last Post: 08-23-2012, 01:43 PM
  2. Return data from Array, intersection of Row and Column
    By ayotte in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-26-2012, 02:20 AM
  3. Return average and count from multiple criteria in a list or array of data
    By robcosta in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-22-2008, 03:18 AM
  4. Replies: 4
    Last Post: 05-02-2006, 11:00 AM
  5. How do I return an entire row of data from a reference array?
    By tvmodica in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-07-2005, 05:06 PM

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