+ Reply to Thread
Results 1 to 22 of 22

VBA Alternative: INDIRECT created on Mac does not function the same in Windows

  1. #1
    Registered User
    Join Date
    07-06-2020
    Location
    Sydney
    MS-Off Ver
    Mac 365
    Posts
    9

    VBA Alternative: INDIRECT created on Mac does not function the same in Windows

    Hi - thanks for any advice help you can help with.

    I've created a table and lookup in order to get a range of numbers based on the table. The table provides all possible outcomes, but I have a dynamic source that will determine the range in the table and produce the final range.

    In Mac 365 I used the following

    =TRANSPOSE(M20:INDIRECT(CONCATENATE("M",ROW(M20)+B7-B6)))

    and it works wonderfully. It
    • dynamically presents the range based on the source value
    • increases or decreases the number of columns based on that range

    Rationale on some of the formula
    • I can't use concatenate because the range can be well over 8000+ ch limit per cell
    • I need to transpose because I need to copy and paste the full range into another application (and rows/breaks are not carried over when pasted)
    • It works because I can shift-control-right to find the full range to copy, without having to scroll endlessly to a specific column to shift-click

    The problem I am having is that, this tool is not for me to use, it's for a workforce who are on Windows. When they open the file in Windows, the number of columns is static based on the range on the saved file that I provided. Meaning changing the Source value, will update the range to the same column only.

    eg
    • if a lower range max, it will produce NA in the subsequent columns
    • if a higher limit, it will cut off at the max column of the file opened.

    It also says "cannot change part of array" when I try and edit, nor does it recognise the same formula. It presents it as

    {=TRANSPOSE(M20:INDIRECT(CONCATENATE("M",ROW(M20)+B7-B6)))}

    Any advice to either help me rebuild in Windows Excel 365 to have the same behaviour?

    Thank you so much!

    EDIT: Sheet instructions

    Change the value in B2 between 1 and 1500; this corresponds to B19 and below, the Sequence number range.
    B10 is where the formula in question is
    • if you enter "1" in B2, you will get a single range in B10
    • if you enter "2" in B2, you will get a corresponding range in B10, C10
    • if you enter "10" in B2, you will get a corresponding range in B10:K10
    • Row 10 will increase in column values per the corresponding Sequence max
    Attached Files Attached Files
    Last edited by wee_wee; 07-06-2020 at 02:53 AM. Reason: attached worksheet

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: INDIRECT created on Mac does not function the same in Windows

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-06-2020
    Location
    Sydney
    MS-Off Ver
    Mac 365
    Posts
    9

    Re: INDIRECT created on Mac does not function the same in Windows

    Thank you!
    Last edited by AliGW; 07-06-2020 at 02:49 AM. Reason: Please don't quote unnecessarily!

  4. #4
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: INDIRECT created on Mac does not function the same in Windows

    Please try to change

    from ROW(M20) to Cell("Row",M20)

    Regards.
    Last edited by AliGW; 07-06-2020 at 02:47 AM.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: INDIRECT created on Mac does not function the same in Windows

    @Menem - there was no rule violation, therefore no need to remove your solution. It's only when we quote rules and specifically say there should be no further responses that you need to do this.

  6. #6
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: INDIRECT created on Mac does not function the same in Windows

    Another my try,

    =Textjoin("",TRUE,INDIRECT(CONCATENATE("M20:M",ROW(M20)+B7-B6)))

    But from your data, it will #value error due to length over 32,767 chars.

    Note: I think that you use an array formula (by press Ctrl-Shift-Enter after enter formula) then copy to the right
    and it maybe array formula behavior to merged them together so it can edit each of them.( I might be wrong)

    Sorry, can't help much.

    Regards.

  7. #7
    Registered User
    Join Date
    07-06-2020
    Location
    Sydney
    MS-Off Ver
    Mac 365
    Posts
    9

    Re: INDIRECT created on Mac does not function the same in Windows

    Thank you so much, Menem for your try. The sample data is only up to 1500, but actually the full data set goes to 9,999 so it would very likely #value out due to length.

    I'm not using any ctr-shft-enter actions, as this is entirely dynamic. The only value that is being inputted by user is B2 (or C18:J18 for purposes of choosing the page retention)

    I just can't figure out why this works in Mac, and not Windows.

    Any other advice from others?
    Last edited by AliGW; 07-06-2020 at 04:47 AM. Reason: Please don't quote unnecessarily!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: INDIRECT created on Mac does not function the same in Windows

    I'm not using any ctr-shft-enter actions, as this is entirely dynamic.
    However, you said this:

    It presents it as

    {=TRANSPOSE(M20:INDIRECT(CONCATENATE("M",ROW(M20)+B7-B6)))}
    This means that Excel for Windows is seeing it as an array-entered formula and presenting it as such.

  9. #9
    Registered User
    Join Date
    07-06-2020
    Location
    Sydney
    MS-Off Ver
    Mac 365
    Posts
    9

    Re: INDIRECT created on Mac does not function the same in Windows

    Hi AliGW, thanks. To be honest, I'm not super familiar with "arrays" or common functions/language in Excel - I can't even be sure I understand how I got what I wrote to work in Mac, it just does.

    All I know is that I put in a value in B2, and it gets me what I need per attached on MAC

    Attachment 685463

    On a windows machine, the same input get's this result

    Attachment 685464

    Just a bunch of N/A until the max range of the originally saved file.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: INDIRECT created on Mac does not function the same in Windows

    On my Windows machine, having opened your file, I see exactly the same as you do on your Mac - no errors anywhere.

    I am on the insider channel, which means my 365 is completely up-to-date, and the TRANSPOSE formula is coming through as a SPILL formula, without the {}.

  11. #11
    Registered User
    Join Date
    07-06-2020
    Location
    Sydney
    MS-Off Ver
    Mac 365
    Posts
    9

    Re: INDIRECT created on Mac does not function the same in Windows

    Is that to suggest that this may be a versioning issue, whereby only certain machines with the most update to date version will be able to handle this formula correctly?

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: INDIRECT created on Mac does not function the same in Windows

    This is how I would interpret it, yes. I can't diagnose error messages that I'm not seeing, but telling you that I'm not seeing them with my version should help you to narrow this down.

    Hopefully someone with a less up-to-date version can confirm what your co-workers are seeing.

  13. #13
    Registered User
    Join Date
    07-06-2020
    Location
    Sydney
    MS-Off Ver
    Mac 365
    Posts
    9

    Re: INDIRECT created on Mac does not function the same in Windows

    Thanks, this certainly is helpful at least hypothesising.

    I can see that the current build is v2006 , where as my version is at the bottom of the list as v1902 on the semi-annual channel.

    If you are also seeing the formula modified to SPILL, that should suggest the newer version of excel does recognise what my file is trying to do (and that in at very least, the Transpose function might not achieve it in Windows).

    As you say, hopefully someone else here can corroborate this

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: INDIRECT created on Mac does not function the same in Windows

    Your Mac build is irrelevant.

  15. #15
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: INDIRECT created on Mac does not function the same in Windows

    That's correct. Unless your version is current enough to include spill functionality, your formulas won't adjust the way you want them to.
    Rory

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: INDIRECT created on Mac does not function the same in Windows

    the Transpose function might not achieve it in Windows
    It will if the version of Excel is up-to-date (current) - I have demonstrated this. It's not the platform that is at issue.

  17. #17
    Registered User
    Join Date
    07-06-2020
    Location
    Sydney
    MS-Off Ver
    Mac 365
    Posts
    9

    Re: INDIRECT created on Mac does not function the same in Windows

    Sorry, i misrepresented that. I meant, the version of 365 I have on a Windows machine (that I'm using to test) is v1902; which is still light years ahead of the Office 2013 the rest of the team have access to.

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: INDIRECT created on Mac does not function the same in Windows

    OK - I'm on bete 2007.

  19. #19
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: INDIRECT created on Mac does not function the same in Windows

    Your current set up definitely won't work on 2013.

  20. #20
    Registered User
    Join Date
    07-06-2020
    Location
    Sydney
    MS-Off Ver
    Mac 365
    Posts
    9

    Re: INDIRECT created on Mac does not function the same in Windows

    Hi AliGW - Can I repost this thread in the VBA sub-forum to see if there's another solution to what I'm trying to do that isn't constraint by version?

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: INDIRECT created on Mac does not function the same in Windows

    No, but I can move the thread to the VBA section - I’ll do that now.

  22. #22
    Registered User
    Join Date
    07-06-2020
    Location
    Sydney
    MS-Off Ver
    Mac 365
    Posts
    9

    Re: VBA Alternative: INDIRECT created on Mac does not function the same in Windows

    Thanks AliGW, hope that someone has any ideas to solve this problem

+ 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. Alternative to INDIRECT function?
    By ACORAM in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-02-2019, 03:20 PM
  2. Replies: 4
    Last Post: 11-10-2017, 10:22 AM
  3. Alternative of INDIRECT function on CLOSED WORKBOOK - No VBA
    By dluhut in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-13-2017, 10:38 AM
  4. Worksheet created in 2007 (Windows XP, 32-bit) freezing in 2007 (Windows 7, 64-bit)
    By mhart210 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-14-2013, 10:58 AM
  5. Macros created in Windows XP not opening /working in Windows 7
    By Janane in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2012, 04:28 AM
  6. Alternative for Defined Name Ranges created by a Macro?
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 09-21-2011, 03:03 PM
  7. Alternative to Indirect()
    By erwina in forum Excel General
    Replies: 3
    Last Post: 09-04-2010, 08:06 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