#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel macro

I have no VBA experience but need to create a macro that:
1 takes a range of cells, searching for the content of each cell
within another sheet in the same workbook.
2 when it finds a match for the content, copies the contents of the
cell to right, and pastes it 2 cells to the right of the cell of the
original cell on the first worksheet.

I would appreciate any assistance you could offer! Thanks in advance.
Rick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default excel macro

assume the cell of values to search is in a single column.

use the built in vlookup formula rather than code

assume the values to be found are in A1:A10

Further assume the range to be searched is on Sheet2, D1:D200 and you want
to return a value from column E
in C1 putting the formula

=if(countif(Sheet2!B:B,A1)0,Vlookup(A1,Sheet2!D:E 200,2,False),"")

then drag fill this down the column.

Regards,
Tom Ogilvy


Rick wrote in message
om...
I have no VBA experience but need to create a macro that:
1 takes a range of cells, searching for the content of each cell
within another sheet in the same workbook.
2 when it finds a match for the content, copies the contents of the
cell to right, and pastes it 2 cells to the right of the cell of the
original cell on the first worksheet.

I would appreciate any assistance you could offer! Thanks in advance.
Rick



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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
passing arguments from an excel macro to a word macro KWE39 Excel Discussion (Misc queries) 1 July 7th 05 03:56 PM


All times are GMT +1. The time now is 01:53 PM.

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

About Us

"It's about Microsoft Excel"