J Jim Aug 1, 2009 #1 I'm having a run time error with this code: NewSht.Range("K72") = OldSht.Range("K69" - "K70" - "K71") Suggestions?
I'm having a run time error with this code: NewSht.Range("K72") = OldSht.Range("K69" - "K70" - "K71") Suggestions?
J Jacob Skaria Aug 1, 2009 #2 Try NewSht.Range("K72") = OldSht.Range("K69") - OldSht.Range("K70") - OldSht.Range("K71") OR NewSht.Range("K72") = OldSht.Range("K69") - (OldSht.Range("K70") + OldSht.Range("K71")) If this post helps click Yes
Try NewSht.Range("K72") = OldSht.Range("K69") - OldSht.Range("K70") - OldSht.Range("K71") OR NewSht.Range("K72") = OldSht.Range("K69") - (OldSht.Range("K70") + OldSht.Range("K71")) If this post helps click Yes
J john Aug 1, 2009 #3 I will assume that you are trying to subtract ranges K70, K71 from K69? see if this way helps: newsht.Range("K72").Value = _ oldsht.Range("K69").Value - WorksheetFunction.Sum(oldsht.Range("K70:K71"))
I will assume that you are trying to subtract ranges K70, K71 from K69? see if this way helps: newsht.Range("K72").Value = _ oldsht.Range("K69").Value - WorksheetFunction.Sum(oldsht.Range("K70:K71"))
R Rick Rothstein Aug 1, 2009 #4 Here is another way do it... With OldSht.Range("K69") NewSht.Range("K72").Value = .Value - .Offset(1).Value - .Offset(2).Value End With
Here is another way do it... With OldSht.Range("K69") NewSht.Range("K72").Value = .Value - .Offset(1).Value - .Offset(2).Value End With