Forum Discussion

LeonelAFM's avatar
LeonelAFM
Copper Contributor
Jul 29, 2022

Macro VBA Excel - Reference to a range of conditioned cells to fill in in other side cells

First, thanks for the help.

I made a test macro to see if it worked and it was OK. However, it references a single cell due to the test.

Now, I need to extend this macro to a range of cells, where each reference cell has a different condition (column "S"), which generates a filling of a certain number of cells depending on the condition of the referenced cell.

In the figure below, I show the worksheet where I intend to apply the macro. Reference cells are in red and the horizontal ranges of cells to be filled in are in purple

The code is below:

1) Read the reference cell

2) Compare its values range

3) Fills/copy in the range of cells as determined by the "IF" conditional

 

Thanks a lot for your help!!

 

Resources