I noticed in the first code at the top that this if statement always runs
I don't know why but it does


x = 5

If x = 4 Or 8 Or 16 Or 32 Or 64 Or 128 Or 256 Then msgbox(str(x))

I modified it to this and then it only runs when x is 4 8 16...
If x = 4 Or x = 8 Or x = 16 Or x = 32 Or x = 64 Or x = 128 Or x = 256 Then MsgBox (Str(x))

but since jay wrote up a different macro that doesn't use this if statement i just thought i would mention it so you don't run in this problem in the future