Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / February 2008

Tip: Looking for answers? Try searching our database.

Variable not defined

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barney - 24 Feb 2008 20:27 GMT
With this macro, why an I getting an error message that my variable 'mr' is
not defined?  Isn't 'mr = ActiveCell.Row' my defining statement?

Sub MoveQuota()
mr = ActiveCell.Row
Range (Cells(mr, "c").Copy(mr, "d"))
Cells(mr, "c").Select
   Selection.ClearContents
Cells(mr, "e").Select
   Selection.ClearContents
End Sub

Thanks,

Barney
Tyro - 24 Feb 2008 20:37 GMT
If you have Option Explicit on, and it sounds like you do,  you must define
every varible before use such as:

Dim mr as long

Using Option Explicit is good programming practice.

Tyro

> With this macro, why an I getting an error message that my variable 'mr'
> is not defined?  Isn't 'mr = ActiveCell.Row' my defining statement?
[quoted text clipped - 11 lines]
>
> Barney
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.