+ Reply to Thread
Results 1 to 6 of 6

VBA to concatenate a string, to a cell value in a range, to another string.

  1. #1
    Registered User
    Join Date
    11-22-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    26

    Question VBA to concatenate a string, to a cell value in a range, to another string.

    Hello,

    I have a column filled with image file names (exp: QU12345 ) on a "Source" sheet of the workbook. On sheet "Results" of this workbook I have to fill a column down to the end where each row of is the result of concatenating www.acme.com\, the respective row with the image name, and - 1.jpg, so that the result will be for example: www.acme.com\QU12345- 1.jpg



    This is what I did, but does not work:
    Please Login or Register  to view this content.
    Could anybody help me please? I tried so many other versions, but nothing I do works. I don't know how to make loops but read many times loops are slow. My files could be 400 rows long, and there 3 other URL addresses I have to concatenate that way in the same workbook.

    I also posted it at http://www.ozgrid.com/forum/showthread.php?t=179664

    Thank you so much for any help.

    (Thanks Mordred, sory about that )
    Last edited by JBeaucaire; 06-17-2013 at 06:07 PM. Reason: Added CODE tags, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thanks.

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: VBA to concatenate a string, to a cell value in a range, to another string.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    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
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VBA to concatenate a string, to a cell value in a range, to another string.

    Maybe:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    11-22-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: VBA to concatenate a string, to a cell value in a range, to another string.

    It works!

    Wow! Why is that? I would love to know.

    Thank you so much!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VBA to concatenate a string, to a cell value in a range, to another string.

    In the end you were trying to create a "string" like a formula from pieces of text. The only thing you missed was that you were ACTUALLY creating a string, and all pieces of string require quotes around them. IF you look in the resulting cells, you'll see the formula you almost created, and the one I did.

  6. #6
    Registered User
    Join Date
    11-22-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: VBA to concatenate a string, to a cell value in a range, to another string.

    Thank you. You are super!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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