+ Reply to Thread
Results 1 to 6 of 6

Simple Excel operation, help needed

  1. #1

    Simple Excel operation, help needed

    Hi there,

    I have text strings in column A and corresponding text strings in
    column B.

    Some text strings in column A are duplicate.

    I want for those duplicate text strings that are in column A to have
    the same corresponding text strings in column B automatically added.

    How can I do that?

    Regards,
    Alexa


  2. #2
    CLR
    Guest

    Re: Simple Excel operation, help needed

    Not sure, are you talking about CONCATENATION?..........if so, in C1 put
    this and copy down.......

    =A1&" "&B1

    Vaya con Dios,
    Chuck, CABGx3


    <[email protected]> wrote in message
    news:[email protected]...
    > Hi there,
    >
    > I have text strings in column A and corresponding text strings in
    > column B.
    >
    > Some text strings in column A are duplicate.
    >
    > I want for those duplicate text strings that are in column A to have
    > the same corresponding text strings in column B automatically added.
    >
    > How can I do that?
    >
    > Regards,
    > Alexa
    >




  3. #3
    Earl Kiosterud
    Guest

    Re: Simple Excel operation, help needed

    Alexa,

    Explain what you mean by "corresponding." You might need to give us a small
    sample of your data. Show the before and the after.
    --
    Earl Kiosterud
    mvpearl omitthisword at verizon period net
    -------------------------------------------

    <[email protected]> wrote in message
    news:[email protected]...
    > Hi there,
    >
    > I have text strings in column A and corresponding text strings in
    > column B.
    >
    > Some text strings in column A are duplicate.
    >
    > I want for those duplicate text strings that are in column A to have
    > the same corresponding text strings in column B automatically added.
    >
    > How can I do that?
    >
    > Regards,
    > Alexa
    >




  4. #4

    Re: Simple Excel operation, help needed

    Here are the text strings in columns A and B:

    Rows Column A Column B

    Row 1 string1 stringA
    Row 2 string2 stringB
    Row 3 string3 stringC
    Row 4 string1
    Row 5 string4 stringD
    Row 6 string3

    Rows 4 and 6 doesn't have any data in column B.

    I want excel to place stringA in Row4,ColumnB and stringC in
    Row6,ColumnB because in previous rows Column A strings have these
    strings in Column B..

    How can I automate this with Excel?

    Regards,
    Alexa


  5. #5
    Sandy Mann
    Guest

    Re: Simple Excel operation, help needed

    Alexa,

    Like Chuck, I'm not sure either but I read it slightly differently. I
    thought that you were saying that there was text in Columns A and B with
    duplicates in Column A but not all duplicates in Column A had the text in
    Column B. The question then was how to fill in the missing text in Column
    B. If so then this code should do the necessary.

    Option Explicit
    Sub FillIn()

    Dim c As Long, s As Long, x As Long, y As Long
    Dim LookFor As String, LookTo As String

    Application.ScreenUpdating = False

    c = Application.CountA(Range("A:A"))
    'If there is other data further down in Column A
    'restrict the range in A:A

    Range("A1:A" & c).AdvancedFilter _
    Action:=xlFilterCopy, CopyToRange:=Range( _
    "Z1"), Unique:=True

    s = Application.CountA(Range("Z:Z"))
    'If there is data in Column Z change the range
    'with all the corresponding Z references in the code

    For x = 2 To s

    LookFor = Cells(x, "Z").Value

    For y = 2 To c
    If Cells(y, 1).Value = LookFor Then
    If Cells(y, 2).Value <> "" Then
    LookTo = Cells(y, 2).Value
    Exit For
    End If
    End If
    Next y

    For y = 2 To c
    If Cells(y, 2).Value = "" Then
    If Cells(y, 1).Value = LookFor Then
    Cells(y, 2).Value = LookTo
    End If
    End If
    Next y

    Next x

    Range("Z1:Z" & s).Value = ""

    Application.ScreenUpdating = True

    End Sub

    HTH

    Sandy

    --
    to e-mail direct replace @mailinator.com with @tiscali.co.uk


    <[email protected]> wrote in message
    news:[email protected]...
    > Hi there,
    >
    > I have text strings in column A and corresponding text strings in
    > column B.
    >
    > Some text strings in column A are duplicate.
    >
    > I want for those duplicate text strings that are in column A to have
    > the same corresponding text strings in column B automatically added.
    >
    > How can I do that?
    >
    > Regards,
    > Alexa
    >





  6. #6

    Re: Simple Excel operation, help needed

    Hi Sandy,

    Can you give exact instructions where I should place this code?

    Regards,
    Alexa


+ 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