+ Reply to Thread
Results 1 to 5 of 5

variable not defined ??

  1. #1
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Wisbech England
    MS-Off Ver
    Excel 2010
    Posts
    308

    variable not defined ??

    Hi All
    Can someone please take a look at my code and tell me why I am getting "variable not defined" error?
    Thank You
    Dan
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: variable not defined ??

    You didn't dim "i".

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: variable not defined ??

    Hi, Dan,

    you´re missing OutMail as well - if you put Option Explicit on top of the Module the Compiler will lead you to the missing Variables if you choose Debug/Compile from the VBE menu.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Wisbech England
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: variable not defined ??

    Quote Originally Posted by HaHoBe View Post
    Hi, Dan,

    you´re missing OutMail as well - if you put Option Explicit on top of the Module the Compiler will lead you to the missing Variables if you choose Debug/Compile from the VBE menu.

    Ciao,
    Holger
    Hi There
    Thank you both for your responses.
    I have made the changes but obviously didn't do it right as I'm still getting an error....

    This is what I have done....

    Please Login or Register  to view this content.

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: variable not defined ??

    i should be a long, not a string

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to Insert defined integer into range defined by variable criteria
    By stereofeedback in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2013, 12:33 PM
  2. Variable not defined error when I have defined the variable
    By jeffadkisson in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-27-2012, 07:00 PM
  3. Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  4. Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  5. Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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