I am trying to increment my column by one in my range. People are saying to use .Cells
for this, but I am getting an error. Type mistmatch
. How can I increment my column of nameColumn
Variable by 1?
sh.Range(sh.Cells(lastR1, nameColumn + 1), sh.Cells(lastR1, lastCol)).AutoFill _
Destination:=sh.Range(sh.Cells(lastR1, nameColumn + 1), sh.Cells(lastR, lastCol))
name column variable:
nameColumn = Split(.Find(Sheets("Input").Range("A2"), .Cells(.Cells.Count), xlValues, _
xlWhole).Address, "$")(1)
nameColumn
aString
? It shouldn't be.sh.Cells(lastR1, nameColumn).Offset(,1)
. Or show us how you are determiningnameColumn
, probably better to work with the column index.1
to as string.colNumber = .Find(Sheets("Input").Range("A2"), .Cells(.Cells.Count), xlValues, _ xlWhole).Column
. Working with the column letter is clunky.