+ Reply to Thread
Results 1 to 3 of 3

Adding new rows changing cell values!

  1. #1
    Registered User
    Join Date
    04-04-2013
    Location
    Maplewood, MN
    MS-Off Ver
    Excel 2010
    Posts
    14

    Adding new rows changing cell values!

    Hey guys I have a vba code Sheets("Inventory").Range("A10").EntireRow.Insert Shift:=x1down, adding a row to the top of the table. Each time I push down the rest of the rows, all the reference values change even when I put dollar sign in front of it.

    I'm writing in my code using vba Sheets("Inventory").Cells(row_start, qtyp_col) = "=sumif($" & partnum_col0 & "$" & row_start & ":$" & pa...............
    Is there any way so that in vba or either excel so that no matter what I do adding new rows or whatever, keeps that cell values the same no matter what??

    Basically I want =sumif($a$1:$a$100000, "fdafdafa" , $b$1:$b$100000) to stay the same, even when I add new rows above this row.

    Any help appreciated, Thanks!

    Xa Vang

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Adding new rows changing cell values!

    try in this format
    =SUMIF(INDEX(A:A,1):INDEX(A:A,1000),"fdafdafa",INDEX(B:B,1):INDEX(B:B,1000))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    04-04-2013
    Location
    Maplewood, MN
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Adding new rows changing cell values!

    Thanks! That works!

+ 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