+ Reply to Thread
Results 1 to 2 of 2

Same thing in 2 different worksheets

  1. #1
    Registered User
    Join Date
    05-05-2009
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Same thing in 2 different worksheets

    I need to do lots of things to 2 different worksheets (an hours and a budget worksheet). Different data goes into each sheet, but the format needs to be the same. In fact, even the cell placement is the same between the sheets. Is there any way that I can easily access both sheets at the same time?

    I find myself doing this alot:
    Please Login or Register  to view this content.
    This is a simple example, in my macro, there is alot more going on, so the repetition is getting annoying and my routines are growing very large. Any advice?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Same thing in 2 different worksheets

    Repetitive actions done sequentially across

    ROWS
    COLUMNS
    Sheets
    Books
    Sequentially designated Ranges

    All of these (and more) benefit from a FOR / NEXT loop. Read up on them.

    http://www.anthony-vba.kefra.com/vba...oop_Structures
    http://exceltip.com/st/Using_Loops_i...Excel/628.html (Exercise 6)

    Example:
    Please Login or Register  to view this content.
    This repetitively evaluates the name of every object in a sheet, if it's a "picture", it deletes it.

    Another:
    Please Login or Register  to view this content.
    This repetitively check the value in column B for each row in a data set, deletes the rows that have error values.
    Last edited by JBeaucaire; 06-04-2009 at 03:40 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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