Replace Name with Unique ID in a List of participants

AnSweden

New Member
Joined
Jul 19, 2009
Messages
4
Hi - I have a 1000+ list of participants and their organizations. I want to replace the value i column B with the Unique ID in column D, IF and only IF it is a match between column B and column C:

VBA_img01%20111015_HS7_012227snap.jpg


I´ve two problems:
1) My VBA-code is case sensitive which is wrong.
Should be => case insensitive.
I´ve tried <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:HyphenationZone>21</w:HyphenationZone> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]-->[FONT=&quot]CompareMode = [/FONT]vbTextCompare etc. How do I solve this?
2) When no match exists the last Uniqe ID is written in the next row and I would like my VB-script to leave that cell as it was.
Here is the result of the first 8 rows:

VBA_img02%20111015_HS7_012226snap.jpg


X => The cellvalue in column A2 and A3 should be left.
Y => The cellvalue should be O_0383

Here is my code - Thank you for your time if you are able to help me. //Regards Anders Söderman

Code:
Private Sub FindReplace()
     
    Dim RowCounter As Long, LastRow As Long
    Dim FindValue As String
     
    On Error Resume Next
    CompareMode = vbTextCompare
    LastRow = Worksheets("Sheet1").Range("B1").Rows.End(xlDown).Row
    For RowCounter = 1 To LastRow
        FindValue = WorksheetFunction.VLookup(Range("B" & RowCounter).Value, Worksheets("Sheet1").Range("C1:D72"), 2, 0)
        Range("B" & RowCounter).Value = FindValue
      Next RowCounter
     
End Sub
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top