+ Reply to Thread
Results 1 to 2 of 2

check name of the Macro

Hybrid View

saravanan1981 check name of the Macro 01-22-2017, 04:30 AM
tim201110 Re: check name of the Macro 01-22-2017, 04:55 AM
  1. #1
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    check name of the Macro

    I have Macro. I have given partial code Where I am Changing value manually case (Range("E2").Value)

    Sub E_mail_Apollo_GMC_GPA()
        'change cell number to change recepient name/cc name/subject etc
            .To = ThisWorkbook.Sheets("Contacts").Range("E2").Value
            .Subject = ThisWorkbook.Sheets("Contacts").Range("H2").Value
            .HTMLBody = StrBody & RangetoHTML(rng) & StrBody2 & .HTMLBody
            ' email code-In place of the following statement, you can use ".Display" to
            ' email code-display the e-mail message.
            .Display
    I want code to change the “E2” in Range("E2").Value automatically.

    Example in if Macro Name is Sub E_mail__Apollo_GMC_GPA()

    I want E2 be changes automatically as B18 (Because B18 is against Apollo). In short Check Macro Name if it contains text “Apollo” then check Column A in Sheet “Contacts” and put the cell number against that.
    In this Example Apollo is in A18 in Sheet “Contacts”. Hence I need B18 .

    if Macro Name is Sub E_mail__Chola_GMC_GPA()

    I want E2 be changes automatically as B18 (Because B3 is against Chola). In short Check Macro Name if it contains text “Chola” then check Column A in Sheet “Contacts” and put the cell number against that.
    In this Example Chola is in A3 in Sheet “Contacts”. Hence I need B3 .

    Same applies to Range("H2").Value
    It should be changed as H18 in first example and as H4 in second example.


    Reason being is The rows in Sheet in “Contacts” will be changing from time to time due to my some other work. Hence Every time I am changing the cell value manually.

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: check name of the Macro

    it'be better if you uploaded your file
    there is a better decision

+ 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. [SOLVED] Macro to compare check-in vs. check-out data
    By skylark332 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-30-2016, 04:12 PM
  2. How to check if excel file is Checked Out in SharePoing Check Out, run code, Check In
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2016, 04:36 PM
  3. [SOLVED] Adjust a macro to check for content of a cell and then run a macro on target sheet
    By dreddster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2013, 04:37 AM
  4. Automatically check one or more check boxes when a parent check box is manually checked
    By Steverizer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2013, 01:56 PM
  5. Macro to force format and check barcode check digit
    By Code Flunkie in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-02-2009, 10:27 AM
  6. Macro to check for blank cell entry, copy previous value, and check for duplicates
    By xPunxNotDeadx in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-26-2009, 06:33 PM
  7. Macro to check range, if false check another range until true, then copy
    By jayers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-12-2009, 04:19 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