+ Reply to Thread
Results 1 to 5 of 5

How to run a macro based on a cell value

  1. #1
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Question How to run a macro based on a cell value

    Morning clever people

    I need a little help again. I want to be able to run the Macro below based on cell "I9" so when I9 = not blank then the macro runs. Is that doable with massive amount of coding?

    Thanks for any help

    This is the current Macro that runs when the Macro button is pressed:

    Sub SaveAs()
    '
    ' SaveAs Macro
    ' Save As
    '

    '
    Sheets("CB Checklist").Select
    ActiveSheet.Unprotect
    Range("M6:N6").Select
    Selection.Copy
    Range("M8:N8").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Application.CutCopyMode = False
    Sheets("CB Checklist").Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Range("M8:N8").Select
    End Sub
    Last edited by mrbret; 11-09-2016 at 12:21 PM.

  2. #2
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: How to run a macro based on a cell value

    HI,

    Please Login or Register  to view this content.
    Please consider:
    Be polite. Thank those who have helped you.
    Click the star icon in the lower left part of the contributor's post and add Reputation. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to run a macro based on a cell value

    Please review the forum rules about posting code. Refer too Rule No. 3. Use code tags when posting too the forum.

    http://www.excelforum.com/forum-rule...rum-rules.html

    Try:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-05-2015
    Location
    Ohio
    MS-Off Ver
    Excel
    Posts
    38

    Thumbs up Re: How to run a macro based on a cell value

    Quote Originally Posted by IonutC View Post
    HI,

    Please Login or Register  to view this content.
    Wow, that simple? Thanks very much



    Quote Originally Posted by JOHN H. DAVIS View Post
    Please review the forum rules about posting code. Refer too Rule No. 3. Use code tags when posting too the forum.

    http://www.excelforum.com/forum-rule...rum-rules.html

    Try:

    Please Login or Register  to view this content.
    Sorry, my mistake, I'd only added it as a visual aide not as a copy/paste. I'll be sure to do the CODE bit next time. Thanks

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to run a macro based on a cell value

    You're welcome. Thanks for the reps. Glad help out, if you are satisfied with the solutions provided then mark this thread as SOLVED. Again refer to the link in Post #3.

+ 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. Replies: 3
    Last Post: 08-16-2014, 09:55 AM
  3. Macro to change colour of cell based on finding a specific word in the cell
    By Shelby761 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2014, 09:46 AM
  4. Create Auto-Calculating Cell and Assign Cell Values Based on a Macro
    By Titanium Fox in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-26-2013, 12:00 AM
  5. [SOLVED] Event Macro to insert text in cell based on input of another cell
    By nplouffe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2012, 11:54 AM
  6. Macro that will clear contents of cell based on format of text in adjacent cell
    By judasdac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2012, 01:56 AM
  7. Macro to auto populate the destination cell based on the values of the previous cell
    By Avinash Kumar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-05-2009, 02:06 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