ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If it is in any of these... (https://www.excelbanter.com/excel-programming/389602-if-any-these.html)

hfazal

If it is in any of these...
 
Hi,

I want my excel macro to search through the columns on a given row and if a
cell equals any of a set of values then make variablex that column.

So check Row 1 to see if any column has a value in this set: rate, level,
average.

If so make that column = variablex

I have most of it figured out. Really don't know how to create/use a set (or
something similar) in VBA.

JLGWhiz

If it is in any of these...
 
Do you want each cell in the column to equal variablex? column = variblex is
illegal.

"hfazal" wrote:

Hi,

I want my excel macro to search through the columns on a given row and if a
cell equals any of a set of values then make variablex that column.

So check Row 1 to see if any column has a value in this set: rate, level,
average.

If so make that column = variablex

I have most of it figured out. Really don't know how to create/use a set (or
something similar) in VBA.


hfazal

If it is in any of these...
 
No, the macro is searching the column headers to find the right column.
However I want to use it on different files and each file has the "right"
column labelled differently. I just want to be able to find the right column
# and the right column being the one that has value a, b, c, d or e.

"JLGWhiz" wrote:

Do you want each cell in the column to equal variablex? column = variblex is
illegal.

"hfazal" wrote:

Hi,

I want my excel macro to search through the columns on a given row and if a
cell equals any of a set of values then make variablex that column.

So check Row 1 to see if any column has a value in this set: rate, level,
average.

If so make that column = variablex

I have most of it figured out. Really don't know how to create/use a set (or
something similar) in VBA.



All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com