VBA Macro IF statement - if column A contains "XXX" then Copy and Paste Certain Cells in that Row into a Specific Cell in a Different Tab

  • Hi all, I need some help with the following:


    • I need a VBA macro that will essentially go into a specific tab, namely 'Data - current month', and look for specific words within Column E ("Classification")
    • The specific word is: 'BBBB / BBB'
    • I then need the macro to copy the values in column D (Company Name) and Column L (Amount) for that associated row that contained the word 'BBBB' in Column E
    • The macro must paste that into a different tab, namely 'Extended' into specific cells i.e. in columns G and H accordingly, starting from row 2 (i.e. not to paste over the headings in row 1)
    • I need this process to be repeated for three different arrays of words. The first mentioned above being BBBB (to be copied into Columns G and H in the 'Extended' tab as above). The second array of words would be: 'GGGG - Specific', to be pasted into columns J and K in the 'Extended' tab
    • The last array of words would be: 'BBBB Total' and 'BBBB Other' (i.e. search for both within the column), to be pasted into Columns N and O in the 'Extended' tab

    I have the below code, but when I tried to tweak it (i.e. with relevant tab names, array word names etc.) it did not do anything really. Is someone able to help with this, pleaasE?


    Many thanks in advance!




  • Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.


    How to use code tags

    Note: no apostrophe in the tags, just used for demonstration here.

    ['code]


    your code goes between these tags


    ['/code]


    Or, just highlight all of the code and press the <> in the post menu above button to add the code tags.


    Thanks.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!