Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hello,
i am quite new to vba programming and i need help with a makro. i want to compare two columns and write "true" or "false" or something similar in another column, if the values are similar. the similarity is limited to lower/upper case letters. here is my code: Code:
Option Compare Text Public Sub StringVergleich() '----- Declaration ------------------- Dim i, j, ez, lz, kez, klz, es, kz, ws As Integer Dim arr As Long Dim CpyStrArray(1, 3 To 5233) Dim CpyStrInt As Integer Dim CpyStr As Variant Dim ObjStr As Variant '----- Variables ---------------------- ez = 3 lz = 2200 kez = 3 klz = 5233 es = 14 kz = 15 ws = 20 For j = ez To lz ObjStr = Cells(j, 11).Value For i = kez To klz CpyStr = Cells(CpyStrArray(1, i), 20) 'CpyStr = Cells(CpyStrArray(i), kz).Value If Trim(LCase(CpyStr)) Like Trim(LCase(ObjStr)) Then Cells(j, ws).Value = "True" Exit For Else Cells(j, ws).Value = "False" End If Next i Next j End Sub 5233) should be compared with the smaller one (3 to 2200). if the smaller clumn contains one of the values listed in the bigger one, the value of a cell in the next column to the right schould be overwritten by "true"/"false". thanks for your help, regards |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Vlookup found two similar values | Excel Discussion (Misc queries) | |||
Finding Most Recent Values in Col1 -- Summing Matching Values | Excel Discussion (Misc queries) | |||
Vlookup on a worksheet with similar values | Excel Worksheet Functions | |||
Counting cells, similar values | Excel Worksheet Functions | |||
Fill values into a listbox matching selected values from a combobox | Excel Programming |