+ Reply to Thread
Results 1 to 8 of 8

Using ranges from two worksheets

  1. #1
    Registered User
    Join Date
    10-18-2008
    Location
    New Jersey
    Posts
    12

    Using ranges from two worksheets

    I would like to perform a calculation with each cell in a range from 2 worksheets and place the result in a range on a third worksheet. I thought I could use the For Each Cell in Range construct but I don't see how to reference the two ranges in a nested pair of For loops. I am sure there must be an simple/elegant way to do this. Can anyone tell me the best way to do this?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Can you explain a little more what you mean. maybe attach an example workbook with some test data in
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-18-2008
    Location
    New Jersey
    Posts
    12

    clarification

    I have numbers in a range (say A1:K15) on Worksheet 1 and a set of numbers in the same range on Worksheet 2. I want to create a third worksheet with the same range populated with the difference (or percentage change) for each cell in that range.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You don't need a macro to do that.

  5. #5
    Registered User
    Join Date
    10-18-2008
    Location
    New Jersey
    Posts
    12
    I actually do need a macro because as part of the loop I need to test each cell to determine its type and to do the appropriate thing with each pair of cells (e.g., to copy strings as is). I just need to know the best way to reference the cells in ranges on 2 worksheets in a loop.

  6. #6
    Registered User
    Join Date
    10-18-2008
    Location
    New Jersey
    Posts
    12
    I also need to use a macro because I need to prompt the user for the names of the two workbooks form which the calculations will be done.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    One of many ways ...
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Registered User
    Join Date
    10-18-2008
    Location
    New Jersey
    Posts
    12
    PERFECT!

    Thank you!

+ 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. Concatenate across multiple worksheets based on variable
    By rpatton1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-09-2008, 03:35 PM
  2. Automatically format multiple worksheets
    By Kez in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-29-2008, 08:25 AM
  3. clear data, retain formula/named ranges
    By inky in forum Excel General
    Replies: 2
    Last Post: 01-28-2008, 05:56 PM
  4. Replies: 2
    Last Post: 10-14-2007, 01:05 PM
  5. Altering ranges in other worksheets without selecting them
    By jw191 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2007, 06:29 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