PDA

View Full Version : VBA to Find & Fill a cell based on row & column headers?



Dimitris254
05-23-2016, 12:48 AM
I'm trying to get a VBA macro to fill two tables that look like this (the forum won't allow me to use urls, please copy&paste manually) : imgur.com/9pURAn7

I have an extra column header ("Market" or "Company") in order to distinguish between the two tables and so that only one cell matches all criteria at a given time:
- 1st column header ("Market" or "Company")
- 2nd column header ("Q1" or "Q2")
- 3rd column header (years: 2015 etc.)
- Row header (name: "Peter" etc.)

Also please note that the last column does not follow the same pattern as the rest ones (the last year has only the latest Q2 forecast).

One solution could be the Intersect function, but the problem is that there are 3 column headers and only one row header so, how are they going to intersect?

----
PS: posted initially over MrExcel, but no solutions given.