+ Reply to Thread
Results 1 to 3 of 3

Have a working macro work on a different sheet in the same workbook

  1. #1
    Registered User
    Join Date
    11-02-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    28

    Have a working macro work on a different sheet in the same workbook

    I have a macro that works. What do I need to add to make it work on a different sheet in the same workbook

    Sub FillDown()

    ' FillDown Macro

    ' All my macro is here and it works
    ' my code here
    ' my code here
    ' if I am on the same sheet as the macro button

    End Sub

    The button to run the macro is on: Sheet1 (Cover)
    I want to click the macro button and ONLY have it run on: Sheet2 (Savings)

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

    Re: Have a working macro work on a different sheet in the same workbook

    Add worksheet references for all the ranges you refer to in the code.

    By the way, FillDown is a VBA method so it might not be a good idea to give your sub the same name.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Have a working macro work on a different sheet in the same workbook

    Maybe:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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