Results 1 to 10 of 75

Thread: vba Copy Paste Conditional to put remark 1 2 3 .. etc

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Hello.
    Quote Originally Posted by fixer View Post
    ...U have mentioned that ignore that post so till today i have not checked that code but today i thought to check the code if there will be any error i will try to solve it .....

    I am not really sure what you are saying here.
    I am sorry, but I do not understand you very well.
    I think you have difficulty speaking in English.
    ( Just out of interest, where do you come from?. What is your mother tongue? Have you tried this https://translate.google.de/?hl=de#v...te&sl=hi&tl=en )






    Quote Originally Posted by fixer View Post
    .. little modification in the code is required
    plz see the sample file
    This was last macro …
    If column B of 2.xlsm match with column B of 1.xls then paste the data from column C of 2.xls as 1,2,3,4,5 and so on....
    &
    If column B of 2.xlsm doesn't match with column B of 1.xls then delete all the data from column C of that row

    Code:
            If IsError(mtchRes) Then  '  If the last line errored than we did not find a match, so from the 3rd up to the last element need to be removed from the array for this row
            Dim Empt As Long
                For Empt = 3 To UBound(arr3(Cnt - 1), 2)
                 Let arr3(Cnt - 1)(1, Empt) = ""
                Next Empt
            Else
            ' a match was found, so we do not need to remove the  1   2   3   etc...
            End If
     
    _.______________________

    This is new requirement…
    If column B of 2.xlsm match with column B of 1.xls then clear all the data in that row from column C
    If column B of 2.xlsm does not match with column B of 1.xls then paste the data from column C of 2.xls as 1,2,3,4,5 and so on…

    New requirement is almost the same, but it is just now
    The other way around,
    or
    Upside down
    or,
    Standing on its head,
    or
    Arse over Tit
    Code:
            If IsError(mtchRes) Then  '  If the last line errored than we did not find a match, so we do not need to  do anything to the array
            ' a match was not found, so we do not need to remove the  1   2   3   etc...
            Else
            ' a match was found, so we need to remove the  1   2   3   etc...
            Dim Empt As Long
                For Empt = 3 To UBound(arr3(Cnt - 1), 2)
                 Let arr3(Cnt - 1)(1, Empt) = ""
                Next Empt
            End If
    ( Full macro is here:
    Sub CopyPasterConditionalToPutRemark_1_2_3_etcArseOverTit() http://www.excelfox.com/forum/showth...ll=1#post13176 )

    Before:
    _____ Workbook: 1 1mai.xlsx ( Using Excel 2007 32 bit )
    Row\Col
    A
    B
    C
    D
    E
    F
    G
    1
    NSE
    15083
    6
    >
    70000
    A
    2
    NSE
    17388
    6
    >
    20000
    A
    3
    NSE
    100
    6
    >
    170000
    A
    4
    Worksheet: Sheet1

    _____ Workbook: 2 1Mai.xlsm ( Using Excel 2007 32 bit )
    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    1
    Symbol
    2
    ACC
    22
    1
    3
    ADANIENT
    25
    1
    2
    3
    4
    ADANIPORTS
    15083
    1
    2
    3
    4
    5
    5
    ADANIPOWER
    17388
    1
    6
    AMARAJABAT
    100
    1
    2
    34
    5
    6
    7
    8
    9
    10
    7
    ASIANPAINT
    236
    1
    2
    8
    Worksheet: Sheet1



    After running macro here: http://www.excelfox.com/forum/showth...ll=1#post13176

    _____ Workbook: 2 1Mai.xlsm ( Using Excel 2007 32 bit )
    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    1
    Symbol
    2
    ACC
    22
    1
    2
    3
    ADANIENT
    25
    1
    2
    3
    4
    4
    ADANIPORTS
    15083
    5
    ADANIPOWER
    17388
    6
    AMARAJABAT
    100
    7
    ASIANPAINT
    236
    1
    2
    3
    8
    Worksheet: Sheet1



    Molly
    Last edited by Molly Brennholz; 05-01-2020 at 06:23 PM.

Similar Threads

  1. Replies: 26
    Last Post: 09-26-2020, 05:56 PM
  2. VBA -- Copy/Paste across sheets
    By Rasm in forum Excel Help
    Replies: 4
    Last Post: 09-21-2012, 02:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •