Copy to cell after comparing between two columns data

reubanrao93

New Member
Joined
Dec 7, 2020
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Column NColumn PColumn R
Housing#VALUEDargon11
2#VALUEwww.google.comR@ND0M2
........

Hi guys,

I'm exploring how to compare data contained in the same row between two columns, then copy to Column C for cell values that don't contain #VALUE in it using VBA and run it all the way down on column R. What's your suggestion on this? Many thanks.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi Try this!
Sub copy_data()
'rows no 5 to 15 ( you need to adjust this part)
For r = 5 To 14

'Column N=14 ,P=16,R=18 ( you need to adjust this part)
If InStr(Cells(r, 14), "#VALUE") > 0 Then
Cells(r, 18).Value = Cells(r, 16).Value
Else
Cells(r, 18).Value = Cells(r, 14).Value
End If
Next r

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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