Morning,
Please can some one help me about VBA code.
In fact, I'd like to write a vba script using offset command but I don't know how to implement it:
A6=(3 or 4 or 5 or 6)
in sheet2 I'd like to fill the next cells(on the same line) according to a condition based on the content of the first cell(sheet2!B2) :
Condition :
cas1 A6=3
if sheet2!B2="X" then write X in the 7th cell from the cell B2
if not
if sheet!B3="X" then write X in the third and fourth field from cell B3
if not
if sheet!B4="X" then write X in the sixth and the third and seventh field from cell B4
if not
if sheet!B5="X" then write X in the second cell from B5 and seventh field from cell B4
and so on for each week
end
Cas2 A6=4
if sheet2!B2="X" then write X in the 11th cell from the cell B2
if not
if sheet!B3="X" then write X in the third and fourth field from cell B3
if not
if sheet!B4="X" then write X in the sixth and the third and nineth field from cell B4
if not
if sheet!B5="X" then write X in the second cell from B5 and seventh field from cell B4
and so on for each week
end
Cas3 A6=5
if sheet2!B2="X" then write X in the 15th cell from the cell B2
if not
if sheet!B3="X" then write X in the third and fourth field from cell B3
if not
if sheet!B4="X" then write X in the sixth and the third and nineth field from cell B4
if not
if sheet!B5="X" then write X in the second cell from B5 and seventh field from cell B4
and so on for each week
end
Cas4 A6=6
if sheet2!B2="X" then write X in the 19th cell from the cell B2
if not
if sheet!B3="X" then write X in the third and fourth field from cell B3
if not
if sheet!B4="X" then write X in the sixth and the third and nineth field from cell B4
if not
if sheet!B5="X" then write X in the second cell from B5 and seventh field from cell B4
and so on for each week
end
each week has 28 columns that must be field following this role.
Thanks
Bookmarks