Search : in
By :

Comparing and pasting

Last answer on Oct 30, 2009 8:50:25 am GMT Himanshu, on Oct 30, 2009 6:40:08 am GMT 
 Report this message to moderators

Hello,

I have 4 columns.

Col1....|....Col2.....|....Col3..|....Col4.....|
----------|--------------|----------|---------------|
A............SSHH.............B......................
B............XXYY..............C......................

Now the macro should compare Col1 and Col3. If any value is found in Col3, den paste the text present at Col2 in Col4.

For e.g. The macro compares Col1 and Col3. It finds B in Col3 and simultaneously it should paste the value XXYY in Col4 (i.e. beside B). It should look like shown below after macro runs.

Col1....|....Col2.....|....Col3..|....Col4.....|
----------|--------------|----------|---------------|
A............SSHH.............B...........XXYY.......
B............XXYY..............C......................

Config­uration: Windows XP Internet Explorer 6.0

Best answers for « Comparing and pasting » in :
Copy/Paste problems when using Firefox Show Copy/Paste problems when using Firefox Pushow Adware Extensions It happens that sometimes, Firefox refuse to copy/paste items. Two assumptions can be made: Pushow Adware You have been infected by an adware, named pushow**.dll...
Comparing the contents of two folders ShowComparing the contents of two folders Under XP, it is possible to integrate a function that allows you to compare the contents of two folders. This may be useful when dealing with folders containing a lot of files and that you...
Vi/Vim - Avoid tabs when making a copy/paste Show[VI/VIM] Avoid tabs when making a copy/paste By default, when you make a copy and paste in vi or vim (through an remote SSH session), it adds incremented tabs at each line. To solve this problem,simply type: set paste in the window or add the...
Quick Copy/Paste under Ubuntu ShowQuick Copy/Paste under Ubuntu Intro Uses: Intro Under Ubuntu there is a quicker alternative to make a Copy/Paste other than using the native CTRL V and CTRL C combinations . You simply select the target text (it is uploaded in...
Download CompareData ShowDescription The application is designed by ZidSoft software groups. Well known worldwide, the application is also simple and easy to use. CompareData is a tool that is used for comparing database. The comparison function allows you to display the...

1

Excelguru, on Oct 30, 2009 7:22:53 am GMT
  • +1

Hello

Try Recording
Put the formula =IF(ISERROR(LOOKUP(C2,A:A,B:B)),"",LOOKUP(C2,A:A,B:B)) in D2
Drag it down
select column D
copy and paste special values
stop recording A wise man once said, 'I complained that I had no shoes until I met a man who had no feet.'
I am interested in financial Modelling and custom excel development with excel macros.

Reply to Excelguru

2

Himanshu, on Oct 30, 2009 8:11:39 am GMT

Hi ExcelGuru,

Thanks very much for the formulae. But when i try to give strings in Column 1, only the 1st alphabet (i.e. 'S' in Sorry ) is picked up for comparison. Hence the strings in Column 3 with words Signature, Sight all are getting the same value as Sorry. This should not happen. The whole string should be compared.

Below take a look at the below example.


Present Case

Col1....|....Col2.....|....Col3..|....Col4.....|
----------|--------------|----------|---------------|
A............SSHH.............Signature.....XXYY............­.....
Sorry............XXYY..............C......................


Expected Result

Col1....|....Col2.....|....Col3..|....Col4.....|
----------|--------------|----------|---------------|
A............SSHH.............Signature.....False...........­......
Sorry............XXYY..............C......................
Same.............PPQQ..............Sorry.....XXYY...........­......

I hope it is clear. Please let me know if you need any further information.

Reply to Himanshu

3

 Excelguru, on Oct 30, 2009 8:50:25 am GMT

Hello

Use Vlookup and FALSE as the last argument A wise man once said, 'I complained that I had no shoes unti­l I met a man who had no feet.'
I am interested in financial Modelling and custom excel deve­lopment with excel macros.

Reply to Excelguru