This code is native VBA, which Excel uses directly. Therefore, confirm that you are trying to automate Excel using VB.NET? Also, show us what you have tried, since it is not the intent of this forum to do complete code-conversions for you.
BTW: I split this out to its own thread (and removed a duplicate post in another thread), since it did not see any relevance to the thread topic you had posted in. Please have a look at our Posting Guidelines
when you have a chance. Thanks and welcome to the forum.
"May the code that you write never work in ways that you didn't expect; and may the code that you didn't write never require you to maintain it". - Ancient Chinese Proverb
Last edited by Cerian Knight; 04-09-2012 at 09:57 AM.