+ Reply to Thread
Results 1 to 11 of 11

VBA using text and ranges

  1. #1
    Registered User
    Join Date
    05-13-2019
    Location
    FL
    MS-Off Ver
    2016
    Posts
    7

    VBA using text and ranges

    Greetings,
    I am looking to use VBA to create a new E-mail and use text template that uses ranges but I can't seem to figure it out of find the answer.


    Please Login or Register  to view this content.
    and assistance would be appreciated.
    Last edited by Pepe Le Mokko; 07-02-2019 at 10:06 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: VBA using text and ranges

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    I have done it for you this time

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: VBA using text and ranges

    maybe this?

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-13-2019
    Location
    FL
    MS-Off Ver
    2016
    Posts
    7

    Re: VBA using text and ranges

    I seem to be getting a Syntax error with either line, even if I remove the second text string.

  5. #5
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: VBA using text and ranges

    it seems like this is missing a parenthesis

    Please Login or Register  to view this content.
    change to this:

    Please Login or Register  to view this content.
    does that fix the problem?

  6. #6
    Registered User
    Join Date
    05-13-2019
    Location
    FL
    MS-Off Ver
    2016
    Posts
    7

    Re: VBA using text and ranges

    I did try that and I receive the same error.

    If I only use

    Please Login or Register  to view this content.
    I wont get an error but nothing will happen.

  7. #7
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: VBA using text and ranges

    okay, try this (might work, haven't tested)

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-13-2019
    Location
    FL
    MS-Off Ver
    2016
    Posts
    7

    Re: VBA using text and ranges

    It doesn't seem to like that either.

  9. #9
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: VBA using text and ranges

    what is the error exactly?

    might need for you to upload a sample workbook so i can see the code in action.

  10. #10
    Registered User
    Join Date
    05-13-2019
    Location
    FL
    MS-Off Ver
    2016
    Posts
    7

    Re: VBA using text and ranges

    I am getting Compile error: Syntax error

    The workbook is essentially empty, just working on this VBA before I try to introduce it into something more complicated.
    It should be attached though.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: VBA using text and ranges

    so i got this fixed. in your commandbutton1 code, put this below the sub line:

    Please Login or Register  to view this content.
    change the subject line to this:

    Please Login or Register  to view this content.
    that should fix the problem.

+ 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. count a text in different ranges
    By mubashar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-17-2014, 12:02 PM
  2. *** VBA Assign Value From Text and Value Ranges ***
    By Backroads23 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2012, 03:01 PM
  3. assinging text to value ranges
    By tkollo1984 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2011, 01:53 PM
  4. Replies: 4
    Last Post: 01-20-2011, 06:01 PM
  5. VBA help - summing a certain text-value in varying ranges
    By Flabbergaster in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-28-2010, 09:37 AM
  6. Validating IP ranges / text
    By rokuk in forum Excel General
    Replies: 2
    Last Post: 02-04-2008, 04:38 PM
  7. Querying text ranges
    By Pyrex238 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-05-2007, 11:14 PM
  8. [SOLVED] How do I compare 2 text ranges and total?
    By Kathryn J Bittman in forum Excel General
    Replies: 3
    Last Post: 12-04-2005, 04:40 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