+ Reply to Thread
Results 1 to 4 of 4

Changing Manually entered matrix values via macro

  1. #1
    Registered User
    Join Date
    09-17-2008
    Location
    San Antonio, TX
    Posts
    2

    Changing Manually entered matrix values via macro

    This problem doesn't seem to be that hard to do, but I'm having a hard time doing it efficiently without hardcoding all the cell locations I'll be changing.

    The basic idea is that I have a matrix (array) from b2:f9, which are all manually entered values. If certain conditions are met, I want to subtract 1 from whatever value is currently in the cell. That part I've already figured out.

    I've got up to 4 cells I have to clear at a time, and I'm having a hard time referencing them correctly. I need something similar to the index and match functions in excel that I can use in VB and I could do it no problem.

    I have the names of the row and column descriptors saved so I can find the intersections and change the data that way, but I'm not sure the easiest way to go about it.

    For example, if cell V12 is true, I wish to decrement each of the values in the manually entered table that made it true.

    This is what I have right now:
    Please Login or Register  to view this content.
    I can already tell this isn't going to be very useful to me as all I'm doing is hardcoding the cell references. I need a way to use the data i have stored in the sheet itself to find out the spots that need decrementing.

    The row and column headers are stored in AA12:AB36, where AA contains cells which have the row headers, and AB contains cells which have the column headers. There are 3 more sets in the proceeding columns so that AC12 & AD12 make another set, AE12 & AF12 make another, etc.

    If ALL 4 of the sets in a row have value > 0 in the manually entered table then ALL 4 of the cells in the table need to be decremented by 1.

    Sorry for being clear as mud but I'm trying to be as clear and concise as I can while being descriptive.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Welcome to the forum.

    I need something similar to the index and match functions in excel that I can use in VB and I could do it no problem.
    Then you are all set: both INDEX and Match are available to VBA:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-17-2008
    Location
    San Antonio, TX
    Posts
    2
    Well thats just awesome then. Is every function in excel available via the WorksheetFunction.* ?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    See VBE Help for worksheet functions

+ 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. Macro to grab external data and paste values into a master spreadsheet
    By Lotus123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-16-2009, 03:11 PM
  2. Userform's listbox values depending on values on certain matrix
    By Juhanen II in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-19-2008, 08:01 AM
  3. Generating permutation matrix according to values
    By lelchuk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-09-2008, 12:02 PM
  4. Sort Sheet based on Changing Values
    By cdogstu99 in forum Excel General
    Replies: 1
    Last Post: 02-19-2008, 04:02 PM
  5. Replies: 2
    Last Post: 12-24-2007, 08:24 AM

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