Link to home
Start Free TrialLog in
Avatar of candychan611
candychan611Flag for Hong Kong

asked on

EXCAL VBA

Hi,

Attached DEMO.XLS , first highlight  by manual  Sheet  PI  A3: H5,  then run  copydata marco ,  please help me  to  amend the  copydata  marco  ( refer to  Sheet PRICE   Column  REF_NO
 ,  to   get the result  as 1.JPG)


Stanley
DEMO.xls
1.JPG
Avatar of nutsch
nutsch
Flag of United States of America image

Here is my version of it.

Thomas

Sub copydata()
Dim wbk As Workbook
Set wbk = ActiveWorkbook

    Selection.Copy
    Workbooks.Add
    ActiveSheet.Paste
    Selection.Offset(0, Selection.Columns.Count).Resize(, 1) = "IC3"

wbk.Activate
End Sub

Open in new window

Avatar of candychan611

ASKER

Thomas,

Your code  only  fill  in  IC3  ,  my desired  result should be lookup  the Sheet PI   REF_NO
 and Sheet PRICE   REF_NO   to find out the VEND_NO.


e.g. REF_NO   1002   should be  103

REF_NO  1006  should be 102 ..........................................................
So take the    REF_NO  from the selection, then look for it in the PRICE Tab, and return the    VEND_NAME corresponding to the    V_ITEM_NO?
Yes right !
ASKER CERTIFIED SOLUTION
Avatar of nutsch
nutsch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial