Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paste where cell meets certain criteria

I want to copy a few columns from one sheet and paste them into anothe
one. This should be done by a macro.

Now the first column doesn't contain any values until down to the 10t
row. I want to copy the selected columns and paste them in the othe
sheet in the columns where the 10th row matches the 10th row of wha
I'm copying.

How do I say 'Look up the value from the 10th row of the first colum
you want to copy, find it somewhere in the other sheet, go to the to
of the column you found it in, and paste everything there?

Easiest thing for me to do would be to record a macro, but I'm not sur
how to include that process of finding the right column.

Hope that somebody can help!
Thanks!
LAR

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Paste where cell meets certain criteria

Dim cell as Range, rng as Range
Dim rng1 as Range, vVal as Variant
for each cell in Selection.columns
vVal = cells(10,cell.column)
set rng = worksheets("Sheet2").rows(10).Cells
set rng1 = rng.find(vVal)
if not rng1 is nothing then
cell.EntireColumn.Copy _
Destination:=rng1.EntireColumn
end if
Next

--
Regards,
Tom Ogilvy

"exceleration " wrote in
message ...
I want to copy a few columns from one sheet and paste them into another
one. This should be done by a macro.

Now the first column doesn't contain any values until down to the 10th
row. I want to copy the selected columns and paste them in the other
sheet in the columns where the 10th row matches the 10th row of what
I'm copying.

How do I say 'Look up the value from the 10th row of the first column
you want to copy, find it somewhere in the other sheet, go to the top
of the column you found it in, and paste everything there?

Easiest thing for me to do would be to record a macro, but I'm not sure
how to include that process of finding the right column.

Hope that somebody can help!
Thanks!
LARS


---
Message posted from http://www.ExcelForum.com/



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
Getting a Value IF a cell meets a criteria ThunderStorm Studio[_2_] Excel Discussion (Misc queries) 1 February 18th 08 07:29 PM
Copy row details where cell value meets certain criteria Sarah (OGI) Excel Worksheet Functions 2 May 17th 07 05:06 PM
How can I get a cell to Flash if it meets a certain criteria in Ex tcfoote Excel Worksheet Functions 1 October 31st 06 04:03 PM
How do I go to the next cell that meets criteria Neil Excel Discussion (Misc queries) 3 May 12th 06 04:34 PM
Get data if cell within a row meets criteria pomalley Excel Discussion (Misc queries) 2 March 2nd 06 03:28 PM


All times are GMT +1. The time now is 05:36 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"