Hello I am facing some issue while running a macro in Excel VBA.
For Each cell In [Data!A2.A65536]
I was using the above code, and was getting type Mismatch error. When I replaced it to
For Each cell In Worksheets("Data").Range("A2:A65536").Cells
the error was gone.
Since I am not well versed in vba, can anyone explain what's the difference in the above snippets? What was the issue due to which the aforementioned issue was happening? and can someone please confirm, if I have correctly replaced the code.