Help with excel macro

Posted on 2012-09-17
Last Modified: 2012-10-14
Hi All

Attached excel

Check Column "A" with column "AP" in sheet "Desktops" If match
then check if Column "C" in "Temp" sheet match name in Column "L" in sheet "Desktop"
If yes then get the column "E" from "Temp" sheet to colum "R,X,Y

Color all rows that were updated in desktop and temp sheet
Question by:bsharath
    LVL 50

    Expert Comment


    column A in the "Desktop" sheet is empty.
    None of the columns in the "Desktop" sheet have data that match with column AP.

    >> If yes then get the column "E" from "Temp" sheet to colum "R,X,Y

    What do you mean by "get"? Copy? Move? Into which sheet? Temp or Desktop?  Do you want the same value in all these columns? Why the duplicates? That does not look like good spreadsheet design.

    You need to be a bit more clear on the specifications. How far did you get with your own macro? Can you post the code? Where did you get stuck?

    We're happy to help you with your coding efforts, but you will need to provide more detailed specifications and the code you already have in place.

    Most of this can be done without VBA, just with formulas. Do you really need VBA?

    cheers, teylyn
    LVL 11

    Author Comment


    I mean column "L" not "A"

    I want to copy from temp to "desktops sheet"

    I am fine with a formula as well

    But vba felt would be easy to run as its a repeated task. Would be used regularly

    Columkn "R" and "X" will be repeated but do have different names in the actual file
    LVL 50

    Expert Comment

    In your data sample, none of the codes in column L match with column AP. Can you confirm that in your real data, there will be matches? Or do all the cells in column L start with "cde"?

    Can you post a data sample that represents use cases for all possible scenarios?

    cheers, teylyn
    LVL 50

    Accepted Solution

    Looking at column E in the temp sheet. One value is


    Do you want to copy that same value to the columns R,X,Y in the desktop sheet?

    You really need to explain the desired outcome. I have a feeling that you want to SPLIT the value in column E and distribute it to R, X and Y.

    That's just my assumption, though.

    Please take a step back and explain your whole requirements from scratch.

    Trying to piece together your real requirements with 20 questions is a waste of your and our time.

    cheers, teylyn
    LVL 11

    Author Comment

    Desktop sheet "AP" has to match Temp sheet "A"
    Desktop sheet "L" match with temp sheet column "C"
    If same then split the temp sheet colum "E" data into 3 parts and paste in desktop sheet
    Yes as you said I want to split the temp sheet "E" into 3 parts and place them in "R,X,Y" columns

    Color the rows on which have been updated with a color so i know what are the changes

    The whole goal is match the employee id and machine name nd update the location of the users

    Its a user database that i want to update

    people have moved from one building to 4 other buildings
    Hope this answers all your questions
    else please buzz me will try to rephrase
    LVL 50

    Expert Comment

    Hello bsharath,

    I'm calling in some other experts, since I have a personal situation that needs my attention.

    cheers, teylyn

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
    This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now