Create template based off criteria

mkting123

New Member
Joined
Sep 23, 2016
Messages
1
Hi All,

I have received some help on this, but still need some guidance. I am trying to make an automated template for others to fill out based on some criteria (i.e., the brand its for and the report they're working on). The template should populate with row headers based on a drop down list in a different tab. Understand that this can be done by Vlookup, but for other purposes it needs to be a macros.

The first tab is the Criteria, which in A1 reads Brand, and then A2 reads Report. There are a list of brands under the Brand header that can be chosen, and then a list of reports that can be chosen. I want a macros to read these selections, then search for them in the second tab called Template Options. Once the brand and report are identified in the Template Options tab (which lists all of the metrics I want to be pulled for the template next to the brand and report names in the adjacent columns), it will populate in the Output tab all the metrics that are needed for that report and brand.

Right now the macros is just populating the criteria in the output page. I need the metrics that are required for that report, however, to populate based on that criteria only.

Right now, I have this beginning:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    

    Dim brand, report, partner As String
    
    brand = Sheets("Criteria").Cells(2, 1)
    report = Sheets("Criteria").Cells(2, 2)

    With Sheets("Output")
        .Cells(4, 1) = brand
        .Cells(4, 2) = report
        .Cells(4, 3) = partner
    End With
    
    Call reportCheck(report)
    
End Sub


Any thoughts? Tried searching other questions, but had difficulty with them.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Your code looks well formed. However:

You said
The first tab is the Criteria, which in A1 reads Brand
but then you have this:
Code:
[COLOR=#333333]brand = Sheets("Criteria").Cells(2, 1)[/COLOR]

.Cells references (row, column). So you have row 2, column 1. That's A2, not A1. Could this be part of your error,

Similarly, you said
and then A2 reads Report
but your code is like this:
Code:
r[COLOR=#333333]eport = Sheets("Criteria").Cells(2, 2)[/COLOR]

That is B2, not A2.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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