I am a bit confused by the cell and range in vba (excel). Logically, I could think of a cell as a range with size = 1; and I think itβs easy to make a range from a cell.
If I read the api of the EntireRow property here it works at range. But the following code work indicating that "cell'variable inside a loop is a range
Set import = Sheets("import") Set spRange = import.Range("A2") Set spRange = import.Range("A2:" & spRange.End(xlDown).Address) For Each cell In spRange dict.Add cell.Offset(0, 2).Text, cell.EntireRow Next cell
At the same time, the code below returns an error indicating a type mismatch when the delete function is called. What should be the type of targetCell in the function definition?
Set spRange = mySheet.Range("b2", mySheet.Range("b2").End(xlDown)) For Each cell In spRange val = removecell (cell) Next cell Public Function removecell(targCell As Range) As Boolean removecell = False End Function
source share