+ Reply to Thread
Results 1 to 5 of 5

VBA Error

  1. #1
    Forum Contributor
    Join Date
    04-15-2008
    Location
    Texas, USA
    MS-Off Ver
    M365 Excel Version 2210
    Posts
    198

    VBA Error

    I have a VERY large Excel 365 workbook running on a Windows 10 platform with many sheets. I want to have the left footer on each page of the printout to be contents of the cell "T1" on the page that it's printing. T1 is a vlookup formula that references another sheet. I have entered the text below as the VBA code in the ThisWorkbook object. When I have a VERY small workbook, this macro works as expected but on this large workbook, it gives me an error and highlights the macro row "WS.PageSetup.LeftFooter = WS.Range("T1").Value" in yellow. I noticed that when I highlighted the yellow macro text, it appears to give me text as if it's reading from an array in the T1 formula from a different table in the workbook.

    Might ANYONE have an answer for me please. I'm totally confused.

    Please Login or Register  to view this content.
    Any help would be greatly appreciated.
    RR
    Last edited by 6StringJazzer; 03-23-2024 at 04:06 PM. Reason: please use code tags

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

    Re: VBA Error

    Please

    • Show the formula that is in T1
    • Give the error number and description (which you should always do when asking about a VBA runtime error)

    If T1 is an array formula it could be producing results that can't be used in a page footer.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    04-15-2008
    Location
    Texas, USA
    MS-Off Ver
    M365 Excel Version 2210
    Posts
    198

    Re: VBA Error

    That's it. Ti has a lookup formula in it. I'll find another way to get around this.

    Thanks for your help.
    RR

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: VBA Error

    Share the formula, ideally in a workbook. If it's producing an array, you could use TEXTJOIN to concatenate the results.

    Sample workbook = more help.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,423

    Re: VBA Error

    pls try activating each sheet before setting the footer.
    Excel can handle each operation separately and avoid potential errors.
    If it still doesn't work, please provide the T1 formula


    Please Login or Register  to view this content.
    Last edited by wk9128; 03-24-2024 at 10:08 PM.

+ 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] Odd Error Handling Behaviour; goes to error handler even when no error?
    By kalikj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2018, 10:04 AM
  2. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  3. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  4. Receiving following error “Complie error : syntax error” Help
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 10:19 AM
  5. 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
  6. 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
  7. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 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