+ Reply to Thread
Results 1 to 4 of 4

Using variable in Application.Index

  1. #1
    Registered User
    Join Date
    04-29-2021
    Location
    PA
    MS-Off Ver
    365
    Posts
    2

    Using variable in Application.Index

    Hello. Hopefully this is an easy question to answer. I am attempting to write the results of an index function performed on an array to another array. I am using the following:

    Please Login or Register  to view this content.
    works as expected. If instead, I substitute the "test" variable for "10" in "[row(1:10)]," I receive Error 2015. Is there a way to use a variable in place of a constant here? I am trying to write certain columns to the array, and the number of rows changes constantly.

    Thanks,

    Mayday

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Using variable in Application.Index

    Hi & welcome to the board.
    How about
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-29-2021
    Location
    PA
    MS-Off Ver
    365
    Posts
    2

    Re: Using variable in Application.Index

    Ugh. I wondered if Evaluate would work but wasn't sure of my syntax since the original uses square brackets. Worked perfectly. Thanks!

    Thanks for the welcome! I have never posted before because I usually find the answer posted already!

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Using variable in Application.Index

    Glad to help & thanks for the feedback.

+ 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. Loop Application.Run with variable parameter
    By WilliamL83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2018, 03:41 PM
  2. [SOLVED] Word.Application variable error
    By rob_h in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2017, 10:01 AM
  3. [SOLVED] Variable loses it's value when using Application.Ontime
    By Tritox in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-22-2016, 01:54 AM
  4. [SOLVED] Specifying Variable Ranges in Application.WorksheetFunction.Min/Max
    By HankW501 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2015, 07:02 AM
  5. [SOLVED] Converting Hlookup to Index Match with variable column index number
    By SimonLock in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-09-2015, 09:14 AM
  6. [SOLVED] How to Have Variable Ranges with Application.WorksheetFunction?
    By BYizz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2013, 08:14 PM
  7. Using Application.Match with a dummy Variable
    By rbateman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-11-2012, 05:37 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