Hi All
I have several sheets but I do not want to clear row 1 which are headers, the vba code is showing compile error invalid next control variable reference.
Can anyone assist
Please Login or Register to view this content.
Hi All
I have several sheets but I do not want to clear row 1 which are headers, the vba code is showing compile error invalid next control variable reference.
Can anyone assist
Please Login or Register to view this content.
Try this:OR:Please Login or Register to view this content.
sht is now an object of type WORKSHEET. The For...Each construct is only used with collection objects (in this case, the Sheets collection)Please Login or Register to view this content.
Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
Last edited by leelnich; 05-23-2017 at 02:23 PM.
in the OP code, changetoPlease Login or Register to view this content.
Please Login or Register to view this content.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Still same invalid next control reference compile error message
Please Login or Register to view this content.
thank you Mike
working now
Please Login or Register to view this content.
Hi Leelnich
Try your second option , working . but the first option giving me the invalid next control variable
Could you post the whole code for the first option for me what going wrong on my side
Actually, I was wrong about the For...Each construction. This works too:Please Login or Register to view this content.
Please Login or Register to view this content.
Last edited by leelnich; 05-23-2017 at 03:12 PM.
Please Login or Register to view this content.
leelnich
Thank you for your solutions,codes working smartly
You're most welcome, and thank you for the rep!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks