+ Reply to Thread
Results 1 to 16 of 16

After vba use my formula stop working as the vba replaces cell values

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    After vba use my formula stop working as the vba replaces cell values

    When my vba delete column c values and upgrade the values as per vba then my formulas in column d whose results are dependent on column c values stops working

    using iferror but unable to solve

  2. #2
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: After vba use my formula stop working as the vba replaces cell values

    Hi ROHAN999
    Have you deliberately posted 4 times the same question?.
    Or was this caused by the Forum Softwäre?
    Did you intend posting 4 times the same question ?
    Alan
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

  3. #3
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: After vba use my formula stop working as the vba replaces cell values

    no while i was uploading this threat due to server reset error it got uploaded so many times unintentially

  4. #4
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: After vba use my formula stop working as the vba replaces cell values

    Quote Originally Posted by ROHAN999 View Post
    no while i was uploading this threat due to server reset error it got uploaded so many times unintentially
    Thanks for letting us know, the Forum software is playing up a bit currently

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: After vba use my formula stop working as the vba replaces cell values

    Hi,

    If you delete column C it would not be a great surprise that formulas dependent upon those cells are affected.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  6. #6
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: After vba use my formula stop working as the vba replaces cell values

    Now plz tell me the solution of my problem

  7. #7
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: After vba use my formula stop working as the vba replaces cell values

    Hi ROHAN999
    Maybe before deleting column C do something like this
    Columns(4).Value = Columns(4).Value
    Alan

    P.s.
    We can only give general ideas if you only give us brief details of your problem
    http://www.excelforum.com/showthread...t=#post4494031
    Last edited by Doc.AElstein; 10-05-2016 at 11:00 AM.

  8. #8
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: After vba use my formula stop working as the vba replaces cell values

    I am not getting you point sir

  9. #9
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: After vba use my formula stop working as the vba replaces cell values

    This formula not working getting #ref

  10. #10
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: After vba use my formula stop working as the vba replaces cell values

    Hi ROHAN999
    You are not giving us enough infomation.
    We cannot help you if you do not give us more detail of the problem.
    We can only give general ideas if you only give us brief details of your problem.
    http://www.excelforum.com/showthread...t=#post4494031
    We need to see your code and / or your workbook.
    You must explain to us what you want.

    If you delete a column that is referenced in a formula then it is obvious that the formula will error after the column is deleted.

    You must tell us what you want to happen.

    My solution will replace the formulas with the value they give prior to the column being deleted.

    If you wish something else to happen then you must tell us what. For example, you could move the column instead of deleting it_..

        Columns(4).Cut
        Columns(100).Insert Shift:=xlToRight

    Alan
    Last edited by Doc.AElstein; 10-05-2016 at 02:51 PM.

  11. #11
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: After vba use my formula stop working as the vba replaces cell values

    In my sheet i am using a vba which have removed in sample sheet

    but narrating what the vba is doing..vba delete the entire row where column d is blank

    and formulas in cell l are dependent on column d

    using indirect function to remove this error but unable to do it
    Attached Files Attached Files

  12. #12
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    What does he want Part ...2) I bet my ... it is not this ... :)

    _..........”.... from last Post........”....


    I still do not understand exactly what you are doing.
    I still do not understand exactly what the problem is
    I still do not understand what you want.

    _.......

    Following what you say:
    Quote Originally Posted by ROHAN999 View Post
    ...vba is doing..vba delete the entire row where column d is blank
    and formulas in cell l are dependent on column d...
    Rem 2 ) '......delete the entire row where column d is blank"

    Sub WTFROHAN999Wants1() 'http://www.excelforum.com/showthread.php?t=1158483&p=4496780#post4496780
    Rem 1 ) Worksheets info
    Dim WB As Workbook                                                       ' Dim:  ' Preparing a "Pointer" to an Initial "Blue Print" in Memory of the Object ( Pigeon Hole with a bit of paper or code lines on that can be filled in to refer to a specific Objec of this type ) . This also us to get easily at the Methods and Properties throught the applying of a period ( .Dot) ( intellisense )                     '
    Set WB = ThisWorkbook                                                    ' Set now (to This Workbook - the one this code is in), so that we carefull allways referrence this so as not to go astray through Excel Guessing inplicitly not the one we want...         Set: Values are filled at the memory locations and the directions there are specified in the variable "Blue Print "Pointer". In this case a Filled in Blue Print is passed.      http://www.excelforum.com/excel-programming-vba-macros/1138804-help-understanding-class-instancing-cant-set-ws-new-worksheet-intellisense-offers-it-4.html#post4387191Set ws = ActiveSheet ' Alternative to last line, make code apply to the current active sheet, - That being "looked at" when running this code        '
    Dim ws1 As Worksheet: Set ws1 = ThisWorkbook.Worksheets("Sheet1")        ''The Worksheets Collection Object of WB is used referrencing by Item string name
    Dim ClmEndOfOppressedWorld As Long                                       ''  Long is very simple to handle, - final memory "size" type is known (123.456 and 000.001 have same "size" computer memory ) , and so a Address suggestion can be given for the next line when the variable is filled in.  '( Long is a Big whole Number limit (-2,147,483,648 to 2,147,483,647) If you need some sort of validation the value should only be within the range of a Byte/Integer otherwise there's no point using anything but Long.--upon/after 32-bit, Integers (Short) need converted internally anyways, so a Long is actually faster. )
     Let ClmEndOfOppressedWorld = ws1.UsedRange.SpecialCells(xlCellTypeLastCell).Row '  http://www.excelforum.com/excel-programming-vba-macros/1156821-find-last-row-or-column-why-not-just-use-specialcells-2.html#post4487154
    Dim rngD As Range: Set rngD = ws1.Range("D2:D" & ClmEndOfOppressedWorld & "")
    Rem 2 ) '......delete the entire row where column d is blank"         - I need to Loop backwards .... When I loop or move forwards or go upwards and then delete something, the next thing I wanted to consider slips down into the “hole” left by the deletion. So when I “move” on I go onto the what is actually the “next next “ and miss out what should have been the next as this next thing has slipped into the “hole” at my present position where I deleted.  Similarly going forward can cause nasty errors, possibly as you have been experiencing if then VBA looks for the thing to consider in a for each. This can occur when it tries to consider something it thinks should be there as it has not considered it yet. ( VBA sometimes makes an internal memory at the start of a Loop of all things and where they are. By "going out of step in a forward step you can confuse it and it looks for something being sure it should be there but it isn’t ( anymore ) !!
    Dim cnt As Long '          Loop Bound Variable Count                  -                                          http://www.mrexcel.com/forum/excel-questions/803662-byte-backward-loop-4.html
        For cnt = ClmEndOfOppressedWorld To 2 Step -1 '                   -                          .... Going or Looping “backwards” or "downwards" means the bits that are “behind me going upwards” slip down and fill in the hole I just made. All these bits have been considered already. The next thing I then consider going backwards is the true next thing i wanted to consider.  http://www.mrexcel.com/forum/excel-questions/787428-clear-delete-shift-%3Dxlup-let-y-%3D-y-%96-1-usedrange-rows-count-anomale-2.html
         If ws1.Range("D" & cnt & "").Value = vbNullString Then ws1.Rows(cnt).Delete                      '  Theoretically a specilal value vbNullString is set to aid in quich checks.. But...  http://www.mrexcel.com/forum/excel-questions/361246-vbnullstring-2.html#post44116
        Next cnt
    End Sub
    Then AFTER is

    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    1
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    2
    0
    #WERT!
    12
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D2)
    0
    3
    0
    #WERT!
    45
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D3)
    0
    4
    0
    #WERT!
    66
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D4)
    0
    5
    Sheet1

    _.. I bet my Willy you do not want that. So you show me now what AFTER you do want. And / or try again to explain.....

    Alan

  13. #13
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    WTF does he want. Part 1

    Hi ROHAN999,
    Thank you for the File

    Sorry, but
    I still do not understand what you are doing.
    I still do not understand exactly what the problem is
    I still do not understand what you want.

    _..................

    You have supplied a File with some data in column D, and Formulas in column L which are dependent on values in column D

    BEFORE: ( Reduced data example of your uploaded File )

    Using Excel 2007 32 bit
    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    1
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    2
    0
    #WERT!
    12
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D2)
    0
    3
    0
    #WERT!
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D3)
    0
    4
    0
    #WERT!
    45
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D4)
    0
    5
    0
    #WERT!
    66
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D5)
    0
    6
    0
    #WERT!
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D6)
    0
    7
    0
    #WERT!
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D7)
    0
    8
    0
    #WERT!
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D8)
    0
    9
    0
    #WERT!
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D9)
    0
    10
    0
    #WERT!
    #WERT!
    #WERT!
    #WERT!
    =VALUE(D10)
    0
    11
    Sheet1

    _.........

    I still do not understand exactly what you are doing.
    I still do not understand exactly what the problem is
    I still do not understand what you want.

    _....Next post.......

  14. #14
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: After vba use my formula stop working as the vba replaces cell values

    now attached sample with my code

    click on code and check that errors are coming in coumn l and m

    how to solve it


    as i am indirect function to solve but as the source change it does not help

    kindly assisst now
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: After vba use my formula stop working as the vba replaces cell values

    oh i solved it by changing the position of o7 to o8

    done it but any ways thanks

    i will again ask for assisstance on this project if require so not closing this threat till then plz bear and assisst if anything will be required i will ask else i will close this thread

  16. #16
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: After vba use my formula stop working as the vba replaces cell values

    Hi ROHAN999
    Thanks for letting us know

    In future please help us to help you by giving a good description and code and sample data from the outset
    From your initial descriptions it was totally impossible to have had any Idea what so ever of your problem
    My efforts were wasted as I was addressing a completely different problem to that indicated by your very brief and incomplete descriptions of the problem

    I appreciate that you may have difficulties in communicating in English. But it is essential if you require further assistance to greatly improve on your description of the problem


    Also, once again, this_...
    Quote Originally Posted by ROHAN999 View Post
    oh i solved it by changing the position of o7 to o8...
    _..tells us nothing. You are again addressing something or some problem or some aspect of some problem. Nobody can follow or understand you


    Please remember that we cannot read your mind


    Alan

+ 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. Replies: 1
    Last Post: 10-09-2016, 10:46 PM
  2. Replies: 1
    Last Post: 10-05-2016, 08:56 AM
  3. Replies: 1
    Last Post: 10-05-2016, 08:56 AM
  4. Formula That Replaces Values With Filler Values (Simplified and Updated)
    By ashishmehra2010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-05-2015, 01:51 AM
  5. [SOLVED] Formula That Replaces Values With Filler Values (Simplified and Updated)
    By artiststevens in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-04-2015, 05:54 AM
  6. replacement with macro stop values from working in formula
    By diederik777 in forum Excel General
    Replies: 6
    Last Post: 12-18-2012, 10:32 AM
  7. cell containing the formulaWhy would a formula stop working in an Excell spreadsheet?
    By Number one Giraffe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-09-2005, 04:05 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