Refer to Specific Column Header and use IF statement to whole columns

Rotsloeh

New Member
Joined
Jun 28, 2022
Messages
2
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi everyone

Is there a way to use VBA to
1. Find a specific Column headers
2. Use IF statement for the whole columns with those specific headers instead of using IF/IFs function
3. Autofill result in a specific Column

I have 3 particular columns in a table that I use. I want to find Columns with Sales and Spend, set a number of conditions ( if Sales is equal to 0 and Spend is equal to 0 is just one of the conditions) and the result of the condition (i.e. 0 Sales, 0 Spend) will be in the 3rd Column Profit Loss.

The table we are using is a downloaded one and the template changes every few months so it affects the formulas. I was wondering if VBA can counter that problem?

 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,214,653
Messages
6,120,750
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