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 Macros with vlookup

Hi ,

I have two worksheets, sheet1 and sheet2. I need to replace a value i
a cell base on the result of the vlookup
from another worksheet. Also, base on another vlookup result, I need t
delete some roww in the first worksheet.

Here is the task that I need to do:

1). I have two worksheets (sheet1 & sheet2) as below:


sheet1
----------
Model Parent Child Qty
M1 A1 B1 1
M1 A1 B2 2
M1 B1 C2 3
M1 C2 C3 1
M1 B2 C4 2
M2 A1 B3 3
M2 A1 B4 1
M2 B3 C2 2
M2 C2 C3 3
M2 B4 C5 1


sheet2
-----------
Model oprt ochild nprt Xqty
M1 B1 C2 A1 2
M1 C2 C3 A1 3
M2 C2 C3 B3 4



2). What I need to do is replace sheet1.parent with a value fro
sheet2.nprt when (sheet1.model & sheet1.parent & sheet1.child)
matched (sheet2.model & sheet2.oprt & sheet2.ochild).

3). Second thing that I need to do right after the above is replace
sheet1.qty with it own original value time sheet2.xqty when
when (sheet1.model & sheet1.parent & sheet1.child)
matched (sheet2.model & sheet2.oprt & sheet2.ochild).

(you can combine with the above when replacing sheet1.parent, it's th
same condition)


4). I will then need to remove whichever row in sheet1 when the ne
result after (2) &(3)- (sheet1.model & sheet1.parent & sheet1.child
matched with (sheet2.model & sheet2.nprt & sheet2.ochild).

After running the macros the result of sheet1 will look like this :

Sheet1
--------------
Model Parent Child Qty
M1 A1 B2 2
M1 A1 C3 3
M1 B2 C4 2
M2 A1 B3 3
M2 A1 B4 1
M2 B3 C3 12
M2 B4 C5 1


Attached is my Excel file for your reference.




Thanks in advance for your help.
Warmest sincere best regards,
Achon

Attachment filename: sample.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=63293
--
Message posted from http://www.ExcelForum.com

 
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
Lookup, vlookup and macros Jp Excel Discussion (Misc queries) 2 October 11th 07 10:03 PM
Macro Size Limit / open macros with macros? andycharger[_7_] Excel Programming 6 February 13th 04 02:00 PM
Macros not appearing in the Tools Macro Macros list hglamy[_2_] Excel Programming 5 October 24th 03 09:10 AM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM
List the Macros that can be executed from Tools-Macros Rob Bovey Excel Programming 1 July 10th 03 05:34 PM


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