LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Copying Values to matching labels

i've got a list of possible labels in column A, and a list of present
labels in column J. Now I want to copy the data from column J to
column b in the row corresponding to the appropriate label (in column
A). Here's what i have so far

Sub Macro1()
Dim rngA As Range
Dim rngB As Range
Dim A As Range
Dim LrowA As Long
Dim LrowB As Long
LrowA = Cells(Rows.Count, "I").End(xlDown).Row
Set rngA = Range("I7:I" & LrowA)
LrowB = Cells(Rows.Count, "A").End(xlDown).Row
Set rngB = Range("A7:A" & LrowB)
For Each A In rngA
myCell = A.Value
A.Select
ActiveCell.Offset(0, 1).Activate
Selection.Copy
rngB.Select
Selection.Find(What:=A.Value, After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Activate
Selection.Paste
Next A
Application.DisplayAlerts = True

End Sub


i'm pretty new to this, so i don't even know if this is the best way to
try and do this, but it keeps flagging the Selection.Paste line with a
runtime error 438, Object doesn't support this property or method. Any
ideas?

oh, and there's some other code that i left out that just parses and
transposes the data, that's why i set the ranges where they are. it's
working so i left it out, but i can put it in if it'd help

 
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
Finding Most Recent Values in Col1 -- Summing Matching Values Rothman Excel Discussion (Misc queries) 5 December 20th 07 08:19 PM
How do I copy info while matching labels? cmccurdy23 Excel Worksheet Functions 0 January 30th 07 02:49 PM
Matching and Copying entries Box666 Excel Discussion (Misc queries) 1 January 9th 06 09:45 PM
Matching and copying problem benneter Excel Programming 1 September 2nd 05 11:55 PM
Fill values into a listbox matching selected values from a combobox Jon[_19_] Excel Programming 4 January 25th 05 04:25 PM


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