Hello Excel fellows,
Quick edit: since "DealDate" and "Date" can be confusing, here is an explanation: DealDate (41000 format) is supposed to be the real date (so column A in Sheet2), and the "Date" (in year) column in Sheet1 corresponds to each year in 3rd in Sheet2. Hope that helps!
I am pretty new to VBA, and I'd like to improve my skills in VBA.
First, thank you in advance for your help! The purpose of my demand is really to improve my skills for my job, so the following demand is just a representation of my real task. The goal is to reproduce it with more difficulty, but it will help me a lot if this exemple gets an answer. So again, thanks in advance!
Goal: the goal of this code would be to input a certain value in the right cell, after the code identifies if the date from the dataset to import corresponds to an existing date in the target worksheets. After it recognizes the date, it has to detect the type of product, and the DealDate of the product. Once it has done it, paste the value in the right cell (row is determined by the date, and column is determined by both DealDate and ProductType). I have included the same explanation in the Excel File, but if you have understood you can avoid reading it
Exemple of the goal: In Sheet1, we have the value in red "0.7". The code should loop to find the DealDate "41772" in Sheet2 (in rows), and detect it's the "Type A" + "2021" column. Then the code should check the corresponding DealDate (2021) and ProductType (Type A), and then copy the corresponding value (0.7) and paste it into the cell it has defined by identifying the right row (where 41772 is) and the right column (Type A + 2021).
I've tried to put the architecture on paper to have a clear idea of how it would work, and my guess is there is only a small part of code which is difficult, the rest will be copy and paste through different arguments (detect Type B instead of A ...). Am I right ?
I hope I was clear in my explanations, though, if you have any question, feel free to ask!
Best,
Casperinoo
Bookmarks