Help with VBA............Again.
Yesterday Joel was kind enough to help me by sending this as a better way of
writng what i had done, it works perfectly, but is there a way that i can use
it to access several ranges, ie instead of just using say A1:A10 B1:B10, by
making, For RowCount = 1 To 10, can i have BB1:A10 B1:B10
BC1:A10 C1:B10
BD:A10 D1:B10
Many thanks.
Private Sub Worksheet_Calculate()
Dim newColor As Integer
Dim myCell As Range
Dim x As Integer
Dim fSpeed
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For RowCount = 1 To LastRow
If Range("A" & RowCount) Range("B" & RowCount) Then
Beep
Range("A" & RowCount).Copy
Range("B" & RowCount).PasteSpecial _
Paste:=xlPasteValues
Set myCell = Range("G" & RowCount)
newColor = 42
fSpeed = 0.4
Do Until x = 10
DoEvents
Start = Timer
Delay = Start + fSpeed
Do Until Timer Delay
DoEvents
myCell.Interior.ColorIndex = newColor
Loop
Start = Timer
Delay = Start + fSpeed
Do Until Timer Delay
DoEvents
myCell.Interior.ColorIndex = xlNone
Loop
x = x + 1
Loop
End If
Next RowCount
End Sub
|