+ Reply to Thread
Results 1 to 13 of 13

Macro for concatenation

  1. #1
    Registered User
    Join Date
    03-06-2012
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    34

    Macro for concatenation

    Hi Champs,

    I have values in A1,B1,C1 and i need a macro to concatenate these in D1 as (valueof A1-valueof B1-valueof C1-00000-00000) .

    Please note: I need the hyphen in between values and 00000 at last. I have attached the sample for the reference.


    Thanks for the help in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro for concatenation

    Why can not you use a simple formula?

  3. #3
    Registered User
    Join Date
    03-06-2012
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Macro for concatenation

    Yes by formula it works. But i need a macro for this scenario.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro for concatenation

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro for concatenation

    Please Login or Register  to view this content.

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

    Re: Macro for concatenation

    FWIW:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-06-2012
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Macro for concatenation

    It works for formula but not for macros. Please help me in VBA syntax of this.

  8. #8
    Registered User
    Join Date
    03-06-2012
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Macro for concatenation

    Thanks JOHN H. DAVIS. your code works fine. Thanks a lot.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro for concatenation

    The code works too. See the attached. You need to adjust your range, as I used current region- Have been very lazy with range.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-06-2012
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Macro for concatenation

    Thanks AB33 for assissting and helping me out of this... cheers

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro for concatenation

    I thought you want to loop through column A. Do you just have a single cell?

  12. #12
    Registered User
    Join Date
    03-06-2012
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Macro for concatenation

    Hi AB33 your code too works fine. Thanks so much ....

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

    Re: Macro for concatenation

    Quote Originally Posted by rajkumarmp View Post
    Thanks JOHN H. DAVIS. your code works fine. Thanks a lot.
    You're welcome. BTW AB33's code works as well and does the entire column.

+ 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] Need to improve speed of concatenation macro
    By engineerlady in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-01-2013, 11:19 AM
  2. Simple concatenation in macro not working...
    By cboshdave in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2012, 11:11 PM
  3. NEED HELP WITH MACRO - Concatenation and then Reformmating
    By evanthekid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2012, 07:38 PM
  4. Concatenation & Macro
    By Barking_Mad in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-23-2011, 07:52 PM
  5. Macro for Find Replace and concatenation
    By john_barnes1987 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-22-2008, 01:38 AM

Tags for this Thread

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