+ Reply to Thread
Results 1 to 2 of 2

VBA and LEFT Combine

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    461

    VBA and LEFT Combine

    Hi All,

    I have company name in Column A. I need the first 12 of this company name in column B. I used to get this done using LEFT formula. Is this possible to combine in vba, so a when I execute the code, I should get the same result.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: VBA and LEFT Combine

    Hi
    assuming your company names are in column 1 starting in cell 2, and you want the output in column B, try this.
    The macro will stop when it reaches a blank cell in column A

    Sub lefts()
    x = 2 ' row with first value
    Do While Cells(x, 1) <> ""
        Cells(x, 2) = Left(Cells(x, 1), 12)
        x = x + 1
    Loop
    End Sub

+ 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. Combine MATCH and LEFT with asterisk?
    By Requin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-18-2017, 04:44 AM
  2. [SOLVED] How to combine Upper Left and substitute in one formula?
    By MI3operations in forum Excel General
    Replies: 4
    Last Post: 03-20-2015, 02:26 PM
  3. Can I combine COUNTIFS with other formula (e.g. LEFT)
    By mrmcmillanrevis in forum Excel General
    Replies: 3
    Last Post: 02-25-2015, 03:48 PM
  4. [SOLVED] Help needed on how to combine LEFT into a VLOOKUP formula
    By TomP1988 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-04-2014, 06:37 AM
  5. Replies: 2
    Last Post: 09-19-2014, 03:47 PM
  6. [SOLVED] Combine VLOOKUP, LEFT, and ISNA to pull area code, place state, leave out #VALUE's?
    By chonchos in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-27-2013, 12:27 PM
  7. Replies: 2
    Last Post: 03-05-2012, 06:06 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