+ Reply to Thread
Results 1 to 5 of 5

AND formula does not work inside the macro module

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    633

    AND formula does not work inside the macro module

    Dear all, If I try to run below macro code inside the macro module then it does not work & showing

    Please Login or Register  to view this content.
    Run-time error '1004'
    Application-defined or object-defined error

    but it works very well in the excel sheet if i use direct formula (manual)
    Last edited by nur2544; 12-30-2013 at 01:22 PM.

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: AND formula does not work inside the macro module

    Hi nur2544,

    Is the code you've posted the entire code?

    The error '1004' usually means you haven't 'told' VBA about the objects you are using.

    You need to start a VBA sub routine by writing something like the below;

    Please Login or Register  to view this content.
    Please advise if this is the entire code you are pasting into the VBA IDE.

    Thanks
    Remember you are unique, like everyone else

  3. #3
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    633

    Re: AND formula does not work inside the macro module

    hi noboffinme , thanks for reply , i have edited the code ,please check now.

  4. #4
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: AND formula does not work inside the macro module

    Hi

    The below code will work until the row where I've added a comment about the unrecognised Function.

    The main error was that you created a variable called 'LastRow' but you hadn't declared it in the code so the compiler doesn't know what it is.

    What exactly do you want to do here?

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: AND formula does not work inside the macro module

    I think your formula length exceed 256 characters.

+ 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. [SOLVED] Formula not working when put inside VBA macro
    By Chrispelletier in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2013, 10:00 AM
  2. [SOLVED] Assigning shortcut key inside the module
    By borgeklungerbo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2012, 04:59 PM
  3. Replies: 2
    Last Post: 03-27-2009, 11:48 AM
  4. How to run a commandbar controled module inside a Macro
    By betty77 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2006, 10:29 AM
  5. Macro inside a formula
    By loopy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-05-2005, 11:26 AM

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