+ Reply to Thread
Results 1 to 9 of 9

Compile error variable not defined

  1. #1
    Registered User
    Join Date
    03-02-2011
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Compile error variable not defined

    Hi,

    I am using macro of Ron for auto mail generation and I have modified it according to my need but as for as I use the original sheet of Ron and make changes on it, it works but when I copy this code into new sheet it gives error message Compile Error: variable not defined. Please help me solving this.

    I am attaching the sheet in which I am using this code. In this sheet I want excel to generate mail when 42 days left in review date.

    2nd thing I want excel to do is generating a reminder mail when 10 days left in review date and show in Reminder column whether reminder sent or not.

    Waiting help for you experts.

    Asif
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,792

    Re: Complie error variable not defined

    FormulaCell is undeclared. Add a declaration for it

    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-02-2011
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Complie error variable not defined

    Hi 6StringJazzer,

    No it doesn;t work as now it gives message (Runtime Error 91: Object variable or with block variable not set). Further in the original worksheet of Ron, he hasn;t added this line as I have changed only Formula range and in mail code ( in my case module 1) the body of the mail.

    Thanks

  4. #4
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Complie error variable not defined

    I declared a variable for FormulaCell, and used it as the LastRow

    Try this:
    Please Login or Register  to view this content.
    Last edited by jwright650; 04-01-2011 at 07:44 AM. Reason: added comment
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  5. #5
    Registered User
    Join Date
    03-02-2011
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Complie error variable not defined

    No its not working. Have you tried it? may be I am doing some mistake. another confusion in my mind is that I have copied all the codes from Ron's sheet but its working on his sheet but not on mine. what is the logic?

    Thanks

  6. #6
    Registered User
    Join Date
    03-02-2011
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Complie error variable not defined

    By the way it is now giving original message i.e compile error: variable not defined. Sorry to add one more thing that I want excel to initiate mailing process ( for reminder) in the way like Ron did i.e. Sen or Not sent message in nex column (Column G) and I want Reminder sent or Not sent in Column H.
    I hope, I am not bothering you

  7. #7
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Complie error variable not defined

    I added my email addy to Column K and it filled in the email...all I had to do was hit "send" and it sent me an email from outlook.

    You may want to write a macro to call this code when a condition is satisfied and then it would send the email for you out of Excel.

  8. #8
    Registered User
    Join Date
    03-02-2011
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    34

    Re: Complie error variable not defined

    That's what I am trying to do but unsuccessful.

  9. #9
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Complie error variable not defined

    Asif,
    Thought about this thread when I saw this....
    See if you can glean any useful info from this.
    Click Here

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1