+ Reply to Thread
Results 1 to 8 of 8

Linking VBA to a cell

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Linking VBA to a cell

    Hi

    I have a spreadsheet which is emailed weekly. The VBA code will automatically insert my branch name and "Banked Hours Report" into the subject line of the email

    This is to be used by other branches,,, is there a way for the VBA to be linked to a cell containing the branch name and insert this and the banked hours heading into the subject line

    Thanks

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    What code are you using/ It shouldn't be difficult to amend it.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    Hi - try this:

    Please Login or Register  to view this content.
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  4. #4
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418
    Hi Roy

    This is the code currently used


    Please Login or Register  to view this content.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try using this code

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418
    Matrixman,,,

    thankyou for your help,,, used your and the current code mixed and figured it out,,,

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

    In this declaration,
    Please Login or Register  to view this content.
    ... strSubject and strTitle are declared as Variants. This declares them all as strings:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    ... of course - you're quite right Thanks for pointing it out shg - my oversight.

+ 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. Inserting a row does not increment reference in cell
    By diguerd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2008, 01:26 PM
  2. Linking Object Size to Cell Value
    By pcarroll0813 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-10-2007, 03:22 PM
  3. using cell content to reference a worksheet tab name in second workbook
    By Conor in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2007, 09:32 AM
  4. Sheet linking and sum of same cell in different sheets
    By Onters in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-28-2007, 06:24 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