|It would be ActiveSheet, not Active.Sheet (no dot)|
The Cells method uses 2 arguments: RowIndex and ColumnIndex
The RowIndex argument has to be a number or an expression that evaluates to a number. The number represents the Row that the cell is in.
The ColumnIndex argument can be a number or a letter or an expression that evaluates to a number or a letter. The number or letter represents the Column that the cell is in.
Cells(1, 1) refers to A1
Cells(1, "A") also refers to A1
Cells(3, 6) refers to F3
Cells(3, "F") also refers toF3
You can also use variables:
srcRw = 3
srcCol = 6
Cells(srcRw, srcCol) refers to F3
Or values in worksheet cells:
A1 contains 4
B1 contains 7
Cells(Range("A1"), Range("B1")) refers to G4 as does
Cells(Cells(1, 1), Cells(1, 2))
Or expressions that evaluate to numbers and/or letters:
Cells(4+4, Left("Tom",1)) refers to T8
I could go on all day!
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.
message edited by DerbyDad03