In my code, I declared these variables:
Dim Field_Name, Datatype, row As Integer
Then, inside the For loop, I have this code:
Field_Name = Worksheets(i).UsedRange.Find("Field Name").Column
Datatype = Worksheets(i).UsedRange.Find("Datatype").Column
row = Worksheets(i).UsedRange.Find("Field Name").row + 1
However, this code generates an "object variable" or with an invalid block variable "runtime error". According to the API, the property Range.Column and Range.row is Long-Only Long. I tried to make the datatype of my variables long, but without success. Looks like VBA expects me to do
Set Field_Name = Worksheets(i).UsedRange.Find("Field Name").Column
Set Datatype = Worksheets(i).UsedRange.Find("Datatype").Column
Set row = Worksheets(i).UsedRange.Find("Field Name").row + 1
However, the specified variables are not objects, so this makes the compilation error required by "Object required".
. , , .