+ Reply to Thread
Results 1 to 6 of 6

Cell values being moved to a new page but still be read by other formulas

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Cell values being moved to a new page but still be read by other formulas

    Hi everyone,

    I have a macro which cuts rows of cells in one worksheet and pastes them into another. In worksheet 1, beside these rows, there are cells which count results. When I activiate the macro it cuts the data rows and moves them to another worksheet, but the cells which count the results automatically adjust to continue to count the cells in the new worksheet

    Is there any way I can have these counting cells only count the cells in the worksheet they are originally in? Here's my formula:

    =COUNTIF('Worksheet 1'!J3:AB3,"Y")+COUNTIF('Worksheet 1'!J3:AB3,"N")

    So when the cells are moved via macro, the formula seems to automatically change to:

    =COUNTIF('Worksheet 2'!J3:AB3,"Y")+COUNTIF('Worksheet 2'!J3:AB3,"N")

    Interestingly enough, i have other counter cells which count complete columns, i.e. J:J, and they don't adjust as the data changes. Any ideas?

    Thanks guys!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Cell values being moved to a new page but still be read by other formulas

    Perhaps instead of CUT and Paste to the new location...
    Have the macro do COPY and Paste to the new location, then ClearContents of the original.

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Cell values being moved to a new page but still be read by other formulas

    Jonmo,

    You know, I never thought of that. I'll certainly give it a try. In any case, do you have any suggestions as to how I could amend the formulas above?

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Cell values being moved to a new page but still be read by other formulas

    You could use INDIRECT

    =COUNTIF(INDIRECT("'Worksheet 1'!J3:AB3"),"Y")+COUNTIF(INDIRECT("'Worksheet 1'!J3:AB3"),"N")

    But I would not recommend it.
    Indirect is volatile and will significantly reduce your sheet's performance if used alot.

    The best solution is the copy/paste instead of cut/paste.

  5. #5
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Cell values being moved to a new page but still be read by other formulas

    Jonmo,

    I tried the indirect method you suggested. It worked great on the one row, but when I tried to copy down the remaining rows that do the same thing it wouldn't copy correctly. I think i'll need to try the whole copy/paste/clear values method you suggested.

    Thanks for your help

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Cell values being moved to a new page but still be read by other formulas

    yep, another argument against using Indirect.

    The range J3:AB3 becomes just a text string within the Indirect function.
    And it won't incriment as it's dragged down.

    This can be accounted for, but you have to get quite clever, and it really just isn't worth it considering the impact it has on sheet performance.

+ 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. Worksheet name moved to an Index page.
    By eber5266 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-18-2013, 10:58 PM
  2. read value in one certain cell and not follow the value to another cell if moved.
    By little help here in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-22-2012, 02:51 PM
  3. Having Macro Read Values Not Formulas
    By somebody113 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2011, 08:42 PM
  4. Replies: 0
    Last Post: 12-11-2010, 07:05 PM
  5. [SOLVED] Sheets Tabs moved to Right Side of Page. How to get back to Left ?
    By Corey in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-07-2006, 12:00 AM

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