+ Reply to Thread
Results 1 to 3 of 3

VBA to change formulas in a group of cells.

  1. #1
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    VBA to change formulas in a group of cells.

    Hey guys,

    I have this 'Top-50' chart, that I'm trying to convert to a dynamic one sorta speak, so that it can rank different things at the push of a button. It looks like this:

    Attachment 559576

    As you can see near the top, I have two series of buttons:
    - One that would allow the user to select "Général", "Positif" and "Négatif"
    - One that would allow the user to switch from 1-50 and 51-100, therefor converting the Top-50 to a Top-100.

    I already have the 1-50/51-100 covered. Basically, the VBA Macro only changes the first number (ie 1 to 51) and since all the numbers under are just an offset +1, they all follow. Simple enough.

    The left part though, not sure how to go about it.

    Bascially, I need it to re-write (or modify) the INDEX/MATCH formulas in cells DV14:DV38 and GX14:GX38, which returns the stock's names (ie. CGI Group, Open Text, Facebook, etc.) according to which ranking system is being used.

    Each ranking system has its own column in our hidden DATA table, and are labeled TRNK, POSRNK, NEGRNK.
    If you take a look at 'CGI Group' in the picture above (which displays our 'Général' ranking system), the formula is:
    Please Login or Register  to view this content.
    So it basically looks at the number 5 cells to its left (worksheet's cell had to be heavily merged due to layout issues), takes that number (in this case, 1) and look for that exact number in DATA[TRNK] where all our stocks are ranked, according to the 'Général' formula...then returns DATA[TITRES].

    Both 'POSITIF' and 'NÉGATIF' would work the exact same way, but referring to a different column than DATA[TRNK]. So bascially:

    Please Login or Register  to view this content.
    Thing is, slowly learning VBA on my own, I'm not sure how to properly build a code to do that yet, as I've never attempted to modify a formula via VBA before.
    Someone willing to help me get going ?
    ...would very appreciated any help !

  2. #2
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    Re: VBA to change formulas in a group of cells.

    Picture didn't work, here's another attempt.

    Top Chart.png

  3. #3
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    Re: VBA to change formulas in a group of cells.

    Nevermind, figured it out.
    ...and strangely proud of that !

+ 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. Group cells vertical change to horizontal
    By matkalg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2015, 06:04 AM
  2. [SOLVED] insert a row to every group and change color of every top row of group
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-13-2014, 11:00 AM
  3. Function to change color to group of cells..
    By kenharding in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-15-2014, 12:35 PM
  4. Replies: 0
    Last Post: 05-28-2013, 04:52 PM
  5. [SOLVED] Change a group of cells to include First Letter of First Name + Last Name
    By jordan1214 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-28-2013, 02:07 AM
  6. how to change a formula for a large group of cells
    By Jen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-02-2005, 12:05 PM
  7. HOw do I change group of cells from absolute reference?
    By bre in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-24-2005, 11:05 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