VBA Macro Copy and Paste Loop Help

Closed
nicole4763 Posts 2 Registration date Tuesday May 31, 2016 Status Member Last seen June 1, 2016 - May 31, 2016 at 06:30 PM
 Blocked Profile - Jun 2, 2016 at 04:22 PM
I need to create a macro that allows me to copy and paste a set of formulas/values down a certain number of times. For example, if I had the following colors in cells B2:D3 and wanted to copy that specific block down to B5:D6, B8:D9 etc. all the way down to a specific row such as row 50, what VBA formula can I use?


B C D
2 red orange blue
3 yellow green purple

5
6

8
9
Related:

1 response

Blocked Profile
May 31, 2016 at 06:32 PM
Ok, what changes the colors, can possibly do the function. Don't check for a color, check for a value! Is this an EXCEL color by numbers? Wow what a great idea!

It's kind of fun to do the impossible! -Walter Elias Disney
0
nicole4763 Posts 2 Registration date Tuesday May 31, 2016 Status Member Last seen June 1, 2016
Jun 1, 2016 at 10:27 PM
Hi,

Sorry I think I made this question confusing! I am not actually using colors, I am just using colors as a value. I actually resposted this question using names to hopefully make it a little bit easier to understand. I would eventually be using formulas in those cells, but I just want to be able to copy and paste those cells exactly as they are (format and formulas) down many times without having to manually do it. Hopefully that clarifies it a little - I appreciate your quick response!

Thanks,

Nicole
0
Blocked Profile
Jun 2, 2016 at 04:22 PM
Hey Nicole!

Try the IF function. Syntax is as follows:
=IF(logic_test,true,false)

With that in mind:
=IF(A1="green","it is green", "it is not green")

Would this help?
0