+ Reply to Thread
Results 1 to 10 of 10

Change code to look for current worksheet?

  1. #1
    Forum Contributor
    Join Date
    08-08-2011
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2007
    Posts
    123

    Change code to look for current worksheet?

    I need help changing code to look for the current worksheet. Excel is looking for the worksheet I used while creating the macro.

    This is what the code currently looks like:

    Please Login or Register  to view this content.
    Last edited by dalewms2; 08-08-2011 at 03:31 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Change code to look for current worksheet?

    HI dalewms2
    Welcome to the forum.
    Firstly, you need to wrap your code in Code Tags to make it more readable and adhere to the standards of this great forum.
    If you do not do this then the moderators may get at you!

    Secondly, assuming that you will attend to the above, your code looks to directly reference a specific worksheet in a couple of places. For example:
    Please Login or Register  to view this content.
    Either replace the worksheet name in quotes with the current worksheet name or if you are using the current worksheet you could use
    Please Login or Register  to view this content.
    as an alternative.

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Change code to look for current worksheet?

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  4. #4
    Forum Contributor
    Join Date
    08-08-2011
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Change code to look for current worksheet?

    Thanks very much barryleajo, that worked great!! I am a newbie to VBA please give me an example of wrapping code with Code tags.

    thanks

  5. #5
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Change code to look for current worksheet?

    Please read post number 3 from me or read the forum rules to find out about code tags. Thanks!

  6. #6
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Change code to look for current worksheet?

    Hie dalewms2,

    Please go to your first post, click Edit, then click Go Advanced. Select all of your code and then click the # symbol which will wrap your code.

  7. #7
    Forum Contributor
    Join Date
    08-08-2011
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Change code to look for current worksheet?

    Is there a solved button???

  8. #8
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Change code to look for current worksheet?

    Thanks dalewm2! To change a thread to solved, you go back to your first post, click Edit and then Go Advanced again except now you'll find Title and No Prefix located in a drop down menu. Select that and you'll see the word "Solved". Select solved and then save your post.

  9. #9
    Forum Contributor
    Join Date
    08-08-2011
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2007
    Posts
    123

    Code to delete rows based on criteria

    Can some one tell me what would the code be to delete rows that have 50, 0, 50 in the last 3 cells?

    50 0 50
    50 0 50
    50 0 50

    Thanks

  10. #10
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Change code to look for current worksheet?

    Hi dalewms2, if your thread is solved you will need to start a new thread with a new title depicting your new problem.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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