I am having a hard time making this macro work. It won't let me use the elseif statement. Any suggestions would be appreciated.
Please Login or Register to view this content.
I am having a hard time making this macro work. It won't let me use the elseif statement. Any suggestions would be appreciated.
Please Login or Register to view this content.
Last edited by JoseK70; 01-12-2012 at 12:33 PM.
Just a heads up, forum rules require you to put any VBA code in between code tags. For examplePlease Login or Register to view this content.
Hi JoseK70,
Your problem looks like you need a SELECT CASE statement to make it easier. If you use the "TO" range in a CASE statement, I think it will do what you want.
See http://msdn.microsoft.com/en-us/libr...(v=VS.80).aspx or
http://support.microsoft.com/kb/213630
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
Thanks for the help. I have one more question. Instead of making my variable LOne an Integer how do I keep it as a decimal? Because when it compares to my sheet it turns LOne into 1 instead of .8.
Thanks.
Try changing the dimension of the variable:
Please Login or Register to view this content.
Thanks for all the help this is what the final code looks like
Please Login or Register to view this content.
I was thinking of SELECT statement too; it will make whoever is editing the code a lot easier to update.
I modified the code
Please Login or Register to view this content.
Ignore the last post. Typed too fast.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks