How To: Create A Pattern In Excel Using A Macro

Share
Embed
  • Published on Nov 11, 2016
  • Hello Viewers, In this video we have created Excel Macro to create a pattern.
    In this example two buttons are given to create and remove the pattern.
    When we click on create pattern button the pattern is created.
    and When we click on remove pattern button the pattern is removed.
    Now, Lets go through the code:
    for the 1st button: we have used nested For loops:
    (i)where the loops will increment by 2 each time due to step 2 and then the cells will be filled with colors to create a pattern.
    here Offset value will shift the number of cells to down-right from the current active cell based on the values given in the offset function.
    then the pattern will be created.

    for the 2nd button: a single line of code is written to remove the pattern.
    you can use the macro any number of times.
    Thanks for watching, please subscribe to our channel.

Comments • 2