for x=2 to rows...........//////To read from uploaded file //////
Hi, sony123!
My suggestions, in priority order:
1) Upload a sample file.
2) If not 1), post the actual code.
3) If not 2), post the related snippet
4) If 2) or 3), post the code into it's proper place (icon on the ribbon that displays "Code" when you hover on it)
5) Do not post "things" like posted that you wrongly call code: it has errors, it's incomplete, ...
6) About your question and the quote, shouldn't it be the no. of records inserted be the upper bound of the For...Next loop (oh, it isn't there, well neither the Next clause) minus the upper bound (yes, it's there!, 2) plus 1?
7) If not 6), then after the For...Next or the QueryB assignment, define a recordset and get the no. of records from it. How to? From the same source where you found the code as I assume that you're not the author. If unavailable, Google's always there.
Regards!
PS: Just in case you didn't notice it, I left you messages at other topics related to this asking precisely about that relation and how you should proceed.
PS2:As a new user you might want (I'd say should and must) read this:
http://chandoo.org/forum/forums/new-users-please-start-here.14/
And if you've yet read it, do it again, slowly, so as to understand it. Thank you.