+ Reply to Thread
Results 1 to 5 of 5

VBA for to - Error 1004

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    EU
    MS-Off Ver
    Excel 2007
    Posts
    17

    Angry VBA for to - Error 1004

    Hi,

    I'm drafting a simple VBA code, I would like to use it to cycle through different options and print a set of tables corresponding to combinations of different options. I'm using For To commands and counts to select different options. Unfortunately, I keep on getting 1004 error. I'm wondering if someone could help me with this small assignment? My code looks like follows:
    Please Login or Register  to view this content.
    Kind regards,
    Konrad

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA for to - Error 1004

    Konrad

    Where/when do you get the error?

    Also, where is the sub Update located and how is it declared?

    Oh, and why do you run it 3 times?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    05-29-2012
    Location
    EU
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: VBA for to - Error 1004

    Norie,

    Thank you very much for taking interest in my modest post. The idea behind the macro is to generate set of PDF with use of a small table. Table represents values for different combinations of indicators, years and group. I've two groups for the indicator, two years and for family groups. Consequently, I've to genereta 2 x 2 x 4 tables. I get the error while trying to compile the code but there is no reference to a particular cell. Macro is assigned to a button in a worksheet. By the way, I updated the code to generate PDFs:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-29-2012
    Location
    EU
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: VBA for to - Error 1004

    The macro stops on:
    Please Login or Register  to view this content.
    I did change the update procedure to Application.Calculate

  5. #5
    Registered User
    Join Date
    05-29-2012
    Location
    EU
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: VBA for to - Error 1004

    Everything is working like a charm, mistakenly I had a wrong name in a range in Excel

+ 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] Getting Error 1004 Object or Application Defined Error - Code to rearrange data
    By BlazzedTroll in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-10-2013, 12:10 PM
  2. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  3. error 1004 application defined error (Moving click button)
    By mdavid800 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-08-2011, 10:13 AM
  4. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  5. [SOLVED] run-time error '1004': Application-defined or object-deifined error
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2005, 05:05 PM

Tags for this Thread

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