Home |
Search |
Today's Posts |
#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
|
|||
|
|||
Not sure, are you talking about CONCATENATION?..........if so, in C1 put
this and copy down....... =A1&" "&B1 Vaya con Dios, Chuck, CABGx3 wrote in message oups.com... 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
|
|||
|
|||
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 ------------------------------------------- wrote in message oups.com... 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
|
|||
|
|||
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 wrote in message oups.com... 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 |
#5
|
|||
|
|||
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 |
#6
|
|||
|
|||
Hi Sandy,
Can you give exact instructions where I should place this code? Regards, Alexa |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel error - Startup (and Acrobat PDFMaker) | Setting up and Configuration of Excel | |||
How can I use Excel as a simple database for Quoting? | Excel Discussion (Misc queries) | |||
How do I convert an existing MS Excel worksheet tracking a simple. | Excel Discussion (Misc queries) | |||
How do I convert an existing MS Excel worksheet tracking a simple. | Excel Discussion (Misc queries) | |||
Help needed with textbox formatting in Excel 2000 | Excel Discussion (Misc queries) |