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: 1
Default Problem moving data


I have data on one sheet "SJournal" that I need to copy or move ont
another sheet "Invoice". I also have a condidtion that I need to meet
Column "A" of "Sjournal" must match column "B" of "Invoice" and th
matches will
be on different rows. For example: "Sjournal" may have
the data 16791 on row 12 (12, "A") and "Invoice may have
the data 16791 on row 67 (67, "B"). If the data matches then I want t
copy rows "J" "K" "L", & "M" to "Invoice".

Following is the code I have:

Dim t As Long
Dim jrnlArr As Variant
Dim invArr As Variant

jrnlArr = Sheets("SJournal").Range("A1:M9999")
invArr = Sheets("Invoice").Range("A1:M9999")

For t = 1 To 9999
If jrnlArr(t, 1) = invArr(t, 2) Then
invArr(t, 10) = jrnlArr(t, 10)
invArr(t, 11) = jrnlArr(t, 11)
invArr(t, 12) = jrnlArr(t, 12)
invArr(t, 13) = jrnlArr(t, 13)
End If
Next t
Sheets("Invoice").Range("A1:M9999") = invArr


The two problems, I think I have: (1) I believe the above code require
the match to be on the same rows. 2) "SJournal" will have 4 matches t
1 "Invoice" match so my data will be over-written.

Example "Invoice" rows:
"A" "B" "C" "D"

2/5/06 16771 CUSTOM MOULDING LLC 216.26
2/5/06 16772 VULCAN THREADED PRODUCTS, Inc. 36.81
2/5/06 16773 VULCAN THREADED PRODUCTS, Inc. 51.29
2/5/06 16774 VULCAN THREADED PRODUCTS, Inc. 19.79

Sample "SJournal" rows:
16771 112.83
16771 28.21
16771 75.22
16772 11.33
16772 2.83
16772 22.65
16773 15.78
16773 3.95
16773 31.56
16774 6.09
16774 1.52
16774 12.1

--
Metraza
-----------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...fo&userid=3164
View this thread: http://www.excelforum.com/showthread.php?threadid=51693

 
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
Moving Data between sheets in the same workbook and moving data between Workbooks. Alison Brown Excel Worksheet Functions 0 February 10th 09 01:03 AM
Referencing Problem with moving cells christy_181 Excel Discussion (Misc queries) 0 August 16th 06 03:32 PM
similar problem to moving to next cell Rose Davis New Users to Excel 2 August 25th 05 05:08 PM
Copying and moving matching data problem Chad[_8_] Excel Programming 3 June 15th 04 06:46 PM
moving cursor, may solve big problem Skyron[_9_] Excel Programming 1 May 14th 04 03:36 PM


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