Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Look for cells with same value in different columns

I need to create a macro that:

For all cells in a column, find the cells with similar values in
another column (whereas all cells are different in the first column,
there can be several identical cells in the second one) and paste the
cells next to them in a third column (this I know how to do!).

I am a beginner using VBA, and quite helpless on this issue! Thanks in
advance for your help!
Franck

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Look for cells with same value in different columns

Below is the code I use. When I run the macro, there is no error
message - but nothing happens!


Sub CopyIdenticalCells()

Dim ColumnI As Range
Dim i As Range
Dim ColumnL As Range
Dim y As Range

Set ColumnI = Range("I3", Range("I" &
Rows.Count).End(xlUp).Address)
Set ColumnL = Range("L3", Range("L" &
Rows.Count).End(xlUp).Address)
For Each i In ColumnI
If i < "" Then
For Each y In ColumnL
If y = i Then
i.Offset(0, 1).Copy Range("O" &
Rows.Count).End(xlUp).Offset(1)
End If
Next y
End If
Next i

End Sub


What is wrong with it?

Franck

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Look for cells with same value in different columns

PROBLEM SOVED - NO NEED FOR ASSISTANCE - THANKS

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare 2 column cells and return the adjacent columns cells data of the cell trebor57 Excel Worksheet Functions 1 February 1st 11 02:54 PM
Summing 2 columns cells into a 3rd colums cells Wayne Cadigan Excel Discussion (Misc queries) 1 May 13th 10 08:34 PM
How to fix columns and cells? boejo Setting up and Configuration of Excel 0 May 14th 09 09:40 AM
Protection of certain cells or columns Thomas Excel Worksheet Functions 2 February 24th 09 07:31 PM
Linking Columns and cells dlvv Excel Worksheet Functions 0 September 7th 05 09:17 PM


All times are GMT +1. The time now is 03:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"