+ Reply to Thread
Results 1 to 4 of 4

Macro redirecting to sheet without being referenced

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    50

    Macro redirecting to sheet without being referenced

    I'm attempting to use a macro that will autofill cells within sheet 'Logs'. Here is the macro I have created.

    Sub LogsOne()

    Application.ScreenUpdating = False
    Sheets("Logs").Visible = True
    Sheets("Logs").Activate
    lastRow = Range("D2").End(xlDown).Row
    Range("A2:C2").AutoFill Destination:=Range(Range("A2"), Range("C" & lastRow))
    Sheets("Logs").Visible = False
    Application.ScreenUpdating = True

    End Sub

    When I run this macro, it works OK, but redirects to another sheet while hiding sheet 'Logs' upon completion. I have no idea why this would be happening.

    Also, if anyone could add to this code in order to paste values of the cells after they are filled, that would help me a lot. (Mods: If I'm breaking a rule by asking 2 questions I apologize, didn't see anything about that within the rules).

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Macro redirecting to sheet without being referenced

    This line is hiding the Logs sheet. So excel fas to go elsewhere.
    Please Login or Register  to view this content.
    Copy paste values

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,966

    Re: Macro redirecting to sheet without being referenced

    Try this:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Registered User
    Join Date
    08-21-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    50

    Re: Macro redirecting to sheet without being referenced

    Worked great! Thank you both.

+ 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. UNC redirecting of fields
    By AppReg in forum Excel General
    Replies: 0
    Last Post: 02-22-2014, 09:29 AM
  2. Replies: 2
    Last Post: 01-23-2014, 11:08 AM
  3. Replies: 1
    Last Post: 03-01-2011, 03:31 PM
  4. Redirecting Pathway in Macro
    By Zan03 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-23-2010, 06:50 PM
  5. Replies: 2
    Last Post: 01-12-2006, 10:35 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