learning2fly
Programmer
Hello,
This is probably totally obvious to an experienced VBA/Excel user. I am finding this problem increasingly frustrating though and would be grateful of some assistance.
I wish to select a group of cells in an Excel workbook using VBA code.
I use the command "Cells" to reference individual cells using variables but cannot seem to find an equivalent to select a group of cells.
For instance I want to select the range B3:B10 in a loop then C3:C10 etc.... and want to use variables to represent the loop iteration and the column length.
This is how I would like it to work:
For i=0 To NumColumns
Cells(2+i, 3: 2+i, 3+NumRows).Select
Selection.DoSomethingFantastic
Next i
But I cannot find the command that can use variables to select a group of cells.
Can anyone help?
Thanks
Gordon
This is probably totally obvious to an experienced VBA/Excel user. I am finding this problem increasingly frustrating though and would be grateful of some assistance.
I wish to select a group of cells in an Excel workbook using VBA code.
I use the command "Cells" to reference individual cells using variables but cannot seem to find an equivalent to select a group of cells.
For instance I want to select the range B3:B10 in a loop then C3:C10 etc.... and want to use variables to represent the loop iteration and the column length.
This is how I would like it to work:
For i=0 To NumColumns
Cells(2+i, 3: 2+i, 3+NumRows).Select
Selection.DoSomethingFantastic
Next i
But I cannot find the command that can use variables to select a group of cells.
Can anyone help?
Thanks
Gordon