Dynamic VBA Code

Ryokaki

New Member
Joined
May 27, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Good morning everyone,

By way of introduction, I am a student in economics and I have an intermediate level in Excel. I would like to ask for the community's help in order to build a macro for an assignment. I am currently following excel lectures on UDEMY but Macros are not part of the chapter so far (i.e. I have very low knowledge of Macro :( )

Here is the scenario:

On the first tab, I have a table dashboard as below;

DASHBOARD
#AreaInspection Date
1Topic A Q1 2020
2Topic BQ3 2020
3Topic CQ1 2020
4Topic DQ2 2020
5Topic EQ3 2020

On the second tab, I have a control sheet as below:

RefAreaDescriptionControl to be performedStatus
A01Topic A [free text][free text][free text]
A02Topic A [free text][free text][free text]
A03Topic A [free text][free text][free text]
B01Topic B[free text][free text][free text]
B02Topic B[free text][free text][free text]
B03Topic B[free text][free text][free text]
B04Topic B[free text][free text][free text]
C01Topic C[free text][free text][free text]
C02Topic C[free text][free text][free text]
C03Topic C[free text][free text][free text]
C04Topic C[free text][free text][free text]
C05Topic C[free text][free text][free text]
D01Topic D[free text][free text][free text]
D02Topic D[free text][free text][free text]
E01Topic E[free text][free text][free text]
E02Topic E[free text][free text][free text]
E03Topic E[free text][free text][free text]


What I would like to do, is to set manually the inspection date for each topic (Topic A and C for Q1, topic B for Q3 etc.). Then, by clicking on a macro button, I would like excel to look up in the "controls" tab, identify all the lines relating to the relevant topic (including the headers) and create a new tab called, for example "Controls to be performed in Q1" which will include all the lines from the tab "controls" relating to Topic A and Topic C. And so on for the the other topics for the other quarters (new tab for Q2 and another one for Q3).
On top of that, I would like the macro to by dynamic and to identify which Topic needs to be inspected in which quarter based on the inspection date project. A sort of "if Topic A as an inspection date Q12020, then, it will go in the tab "Controls to be performed in Q1".

I would be so grateful if you can help me to write the script :)))

Many thanks in advance,
Best regards,
Ryo,
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top