In the macro I am using I am defining my Range like this:
I was curious as to whether or not I could use the Cells Property, this would help in allowing me to shorten up my macro.
I was trying to make it into something like this:
I know that I can write this in vba without any issues:
Thing I can not get to work is when I do not use 1 of the cells that is between that range.
I know that the 2nd example of code I have would not work with the ":", I would have to use a "," like I did for the 3rd example.
In summary what I need to find out is how to write a Range that uses the Cell property that goes from Cell(6,2) to Cell(21,2) that will also include Cell(23,2).
My first example does this, but I do not want to use "B6", it must be in Cell format.
Any help would be appreciated.
Code:
Set LosBcolran = Numb.Range("B6:B21,B23")
Set LosCcolran = Numb.Range("C6:C21,C23")
Set LosDcolran = Numb.Range("D6:D21,D23")
Set LosEcolran = Numb.Range("E6:E21,E23")
Set LosFcolran = Numb.Range("F6:F21,F23")
Set LosGcolran = Numb.Range("G6:G21,G23")
Set LosHcolran = Numb.Range("H6:H21,H23")
I was curious as to whether or not I could use the Cells Property, this would help in allowing me to shorten up my macro.
I was trying to make it into something like this:
Code:
Range(Cells(6,2):Cells(21,2), Cells(23,2))
etc.
I know that I can write this in vba without any issues:
Code:
Range(Cells(6,2), Cells(23,2))
Thing I can not get to work is when I do not use 1 of the cells that is between that range.
I know that the 2nd example of code I have would not work with the ":", I would have to use a "," like I did for the 3rd example.
In summary what I need to find out is how to write a Range that uses the Cell property that goes from Cell(6,2) to Cell(21,2) that will also include Cell(23,2).
My first example does this, but I do not want to use "B6", it must be in Cell format.
Any help would be appreciated.