PDA

View Full Version : [SOLVED:] Cross section by matching column and row headings



twmills
10-19-2022, 08:07 AM
Hello,

I'm trying to plug in a vba code that will make a cell active based on cross referencing headings in both the column and row. Since the location of the headings may change in it's row or column, I can't use an absolute cell reference like (K67), or any Offset codes to find the location based on the heading.

For instance:
In column A the code will be looking for a heading called 12b-1 Exp, and in Row 4 it'll look for the month of August 2022. So If "12b-1 Exp" happens to be in A67, and "August 2022" appears in K4, then I need the macro to make cell (K67) active (which provides an amount I need to extract).

Attached is an example of the file I'm working with.
30258
Hope this makes sense.

Thanks so much

snb
10-19-2022, 08:24 AM
In column A the code will be looking for a heading called 12b-1 Exp

How does the code know ?

and in Row 4 it'll look for the month of August 2022

How does the code know ?

twmills
10-19-2022, 08:39 AM
In column A the code will be looking for a heading called 12b-1 Exp

How does the code know ?

and in Row 4 it'll look for the month of August 2022

How does the code know ?


I guess that's what I'm trying to figure out. I was thinking doing something along the lines of two Find codes:

FindRow = .Range("A:A").Find(What:="12b-1 Exp", LookIn:=xlValues)

Set Found = Rows(4).Find(what:="August 2022", LookIn:=xlValues, lookat:=xlWhole)

Then somehow find the cross section of those two "find" codes.

Thanks

arnelgp
10-19-2022, 08:47 AM
you put the cursor to the Column of the "month" you want.
then click the button.

twmills
10-19-2022, 10:31 AM
you put the cursor to the Column of the "month" you want.
then click the button.

Yes, that seemed to work.

Thank you!