+ Reply to Thread
Results 1 to 4 of 4

Store formulas in range into array

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    19

    Store formulas in range into array

    Hi All,

    I am try to store the formulas in a certain range into an array, in order to paste them again at some point later.

    This is what I am trying to do and I get a run-time error '13' Type mismatch. (it is only part of the code, I didnt want to include everything)

    Please Login or Register  to view this content.
    So, not all the cells in the range have a formula. Some have numbers or blanks. I read in the excel help that Range.Formula object should deal with nonformulas.

    Any ideas?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Store formulas in range into array

    This will get you the formula cells in a selection, but writing back you be a pain as the relative cell position would be lost.

    Please Login or Register  to view this content.
    Maybe best to use all the cell in the select to get a row by column matrix.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    04-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Store formulas in range into array

    Thanks.

    I think I solved the problem by looping over the rowns and columns of the array and inserting the formulas one by one. I cannot pass the Range all at once.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Store formulas in range into array

    Did you try without specialcells? The loop in this code is just for display of loaded information

    Please Login or Register  to view this content.

+ 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