Your SQL statement will only work if your range has exactly as many cells as the table Test_1 has fields. Otherwise, you have to specify the field names too.
And if ALL fields are text fields.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Split from this thread.
i) i changed the code in my VBA Code as per comments,
It is working fine & select Empty cell also and I change the code for add new column as per below , it is working
Set rng = ws. Range("A2:AA" & lastRow)
ii) But I copy the full code & run , the error has come
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Your SQL statement will only work if your range has exactly as many cells as the table Test_1 has fields. Otherwise, you have to specify the field names too.
And if ALL fields are text fields.