+ Reply to Thread
Results 1 to 6 of 6

Excel sub not working on new sheet

  1. #1
    Registered User
    Join Date
    11-10-2021
    Location
    Canada
    MS-Off Ver
    Office365
    Posts
    3

    Excel sub not working on new sheet

    Hi All,
    I'm not a programmer by any means but am trying to work on a project. I have a sub created that finds the last row, puts a thick border line below it and puts the next business day in the start of the next row. On the sheet I created it in, it works without an issue, however, when I try to put it in other sheets in the same workbook, it errors out with a mismatch error. I have tried my best to solve the issue but after hours of googling, I still can't figure it out. It shows an issue with the last line "Range("B"..." but I can't figure out the issue and why it will work on the original sheet I created and not the copied one. I have even tried copying the entire sheet and it does not work. The code is in "ThisWorkbook." There is another code running on each page that just inserts the time when text is entered into another cell. I don't think it effects the code below, but I have included it just in case. Any help would be greatly appreciated. Thanks!

    Please Login or Register  to view this content.

    Other code on each sheet:

    Please Login or Register  to view this content.

  2. #2
    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,090

    Re: Excel sub not working on new sheet

    Please see the yellow banner at the top of the page.
    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


  3. #3
    Registered User
    Join Date
    11-10-2021
    Location
    Canada
    MS-Off Ver
    Office365
    Posts
    3

    Re: Excel sub not working on new sheet

    Thanks TMS. Sorry I missed the banner . I assume you are referring to the sample workbook? I believe I have attached one to this post. Please let me know if you were referring to something else.
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Excel sub not working on new sheet

    Why have you got the square brackets in the Offset([1], [-1]) ?

    Try removing them
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    11-10-2021
    Location
    Canada
    MS-Off Ver
    Office365
    Posts
    3

    Re: Excel sub not working on new sheet

    Thanks Richard! That seems to have solved it. I will test it in full soon and then mark the thread as closed.

    Can't believe it was brackets causing the issues.

    Thanks again!

  6. #6
    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,090

    Re: Excel sub not working on new sheet

    I can't see where you actually call that routine.

+ 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] Vlookup function not working from another sheet in same excel.
    By redwarez in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-13-2020, 01:36 PM
  2. Excel 2007 : email hyperlink from excel sheet not working
    By RROBBO1964 in forum Excel General
    Replies: 6
    Last Post: 09-06-2012, 06:02 AM
  3. My excel sheet working very slowly! why?
    By promits89 in forum Excel General
    Replies: 3
    Last Post: 04-30-2012, 01:59 PM
  4. Href is not working in my excel sheet
    By Saravana Prabhu in forum Excel General
    Replies: 4
    Last Post: 12-13-2010, 08:58 AM
  5. # tag not working from I.E loading Excel sheet
    By ahgoodreg in forum Excel General
    Replies: 0
    Last Post: 10-24-2007, 03:56 AM
  6. My hide sheet option in excel is not working
    By arleen in forum Excel General
    Replies: 1
    Last Post: 10-25-2005, 02:05 PM
  7. formulae have stoped working on an excel sheet
    By annoyed in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-20-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