ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   compare columns (https://www.excelbanter.com/excel-programming/368391-compare-columns.html)

abulenta

compare columns
 
Hi

I am trying to create a code in Vba to compare the text of 2 columns in
Exel (for finding a list of words that are equal between the two) and
create another column with the result .Can you help me?



Graham Whitehead

compare columns
 
For aguments lets suppose that the data to be compared are in columns A and
B - cells 1 to 10 respectively, and if they dont match fasle will appear in
the corresponding row in column C.

dim strA as string
dim strB as string
dim x as integer

for x=1 to 10
strA=cells(x,1)
strB=Celss(x,2)
if strA<strB then cells(x,3).value = false
next x


"abulenta" wrote in message
...
Hi

I am trying to create a code in Vba to compare the text of 2 columns in
Exel (for finding a list of words that are equal between the two) and
create another column with the result .Can you help me?





abulenta

compare columns
 
yes it works but i need to compare each cell of the column B with each cell
of the column A,
maybe i need to use the comand loop until ?

"Graham Whitehead" wrote:

For aguments lets suppose that the data to be compared are in columns A and
B - cells 1 to 10 respectively, and if they dont match fasle will appear in
the corresponding row in column C.

dim strA as string
dim strB as string
dim x as integer

for x=1 to 10
strA=cells(x,1)
strB=Celss(x,2)
if strA<strB then cells(x,3).value = false
next x


"abulenta" wrote in message
...
Hi

I am trying to create a code in Vba to compare the text of 2 columns in
Exel (for finding a list of words that are equal between the two) and
create another column with the result .Can you help me?







All times are GMT +1. The time now is 07:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com