+ Reply to Thread
Results 1 to 3 of 3

Insert cell value in Array function VBA

  1. #1
    Registered User
    Join Date
    07-12-2013
    Location
    mexico
    MS-Off Ver
    Excel 2010
    Posts
    18

    Insert cell value in Array function VBA

    Hello everyone,

    I have the following macro that automatically filters a column which contains numbers from 1 to 200

    Please Login or Register  to view this content.
    In the part Array("2", "3","4") it is contained the numbers to be filtered.

    However I have a cell, let's say B1, that contains the array to be filtered, for example: "4","9","12" or any combination (this cell changes every time)

    How can I instert this cell value (B1) in the macro so it filters the data B1 contains? I imagine something like:

    Please Login or Register  to view this content.
    Which is the correct form to do this?

    Thanks a lot!!!

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Insert cell value in Array function VBA

    Use Split() to split the string based on the comma separator into a string array. You may then need to use WorkSheetFunction.Transpose.

    A short example file helps us help you more directly.

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Insert cell value in Array function VBA

    Say B1 contains:

    2,3,4

    then:

    Please Login or Register  to view this content.
    Gary's Student

+ 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. index function error using match function to get data from a cell in an array
    By mabildgaard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2013, 02:21 AM
  2. Replies: 5
    Last Post: 05-07-2013, 08:34 AM
  3. Insert an array in a 1-dimensional function
    By Numerator in forum Excel General
    Replies: 2
    Last Post: 11-13-2010, 07:46 PM
  4. Syntax to insert an array formula in a cell
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2006, 05:40 PM
  5. How do I always insert last cell from a increasing array ?
    By Radu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-02-2005, 07:10 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