Private Sub Worksheet_Calculate() Dim cel As Range Dim Addr As Variant, Targ As Variant Static Stocks(3) As Double 'Starts with element 0 Dim i As Long, n As Long Addr = Array("AQ3", "AV3", "AP3", "AU3") 'Watch these cells for price changes Targ = Array(85, 85, 20, 20) 'Look for prices above these threshhold values n = UBound(Stocks) For i = 0 To n With Range(Addr(i)) If Stocks(i) <> .Value Then Stocks(i) = .Value If .Value > Targ(i) Then Open "C:\Users\User\Documents\ABC.txt" For Append As #1 'Change path & name to suit Write #1, .Address(False, False), .Value, Date, Format(Time, "hh:mm:ss.ss") Close 1 End If End If End With Next End Sub
|What code would I use to automate changing the tab (sheet) names in an excel spreadsheet?||17||43|
|VBA Array, write each column's start position into an array||17||36|
|ADD New Entries||7||16|
|need help with vbscript to consolidate multiple work books with multiple work sheets into a new workbook||8||10|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
18 Experts available now in Live!