+ Reply to Thread
Results 1 to 3 of 3

Running a Macro based on a cell reference

  1. #1
    Registered User
    Join Date
    07-27-2015
    Location
    British Columbia, Canada
    MS-Off Ver
    2007
    Posts
    89

    Running a Macro based on a cell reference

    I have produced 3 marco's to copy cells and paste them into another location.

    When I assign the macros 1 by one to a gif image the copy and past works.

    What I would like to do now is have a macro that can run run and based on the value run the corresponing Macro.

    I have Macro9, Macro10, Macro11.

    I have MarcoRead as what I call the Master Read.
    I think I have the code correct at least it does not fail.

    When I enter say 9 in cell O1 and run the MacroRead it does not run Macro9 and the same if I enter 10 or 11 in cell O1.

    I'm using the little Blue guy as my trigger for MacroRead

    I'm trying to google the flow but not find simular tasks.

    John
    Attached Images Attached Images

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,268

    Re: Running a Macro based on a cell reference

    Hi John,

    Is Roster a number or text? Your code doesn't know either.
    How about doing a:

    Dim Roster as Double
    Roster = Range("O1").Value

    and then see what happens from there.

    If you wanted to get fancy you could also use a Select Case construct for your code.

    Look at:
    http://www.ozgrid.com/VBA/select-case.htm
    Last edited by MarvinP; 02-28-2016 at 02:40 AM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    07-27-2015
    Location
    British Columbia, Canada
    MS-Off Ver
    2007
    Posts
    89

    Re: Running a Macro based on a cell reference

    Hello MarvinP
    Thank you for the "Value" vs my Select.

    It is working nicely.

    John

+ 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. Using Macro to change cell color based on reference cell value in different sheet
    By Emma Ford in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2015, 03:51 AM
  2. MACRO - Pivot filter based on cell reference
    By maikoz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2014, 04:02 AM
  3. Running Macro based on value of a certain cell.
    By birminghamguy86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2011, 06:41 AM
  4. macro to increase a cell’s value based on a reference
    By wiggles8831 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2011, 03:50 PM
  5. Unintended cell reference updates when running macro
    By NickBach in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-27-2011, 07:35 AM
  6. Running Macro based on a cell being equal to specific value
    By mbrady1973 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2009, 07:11 AM
  7. Running Macro based on Cell value
    By titovalle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2007, 02:53 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