I'm using VBA to track dynamic data in excel. This code
Works nicely but I want my list to fill horizontally not vertically. Can the new data be added from left to right?
Keeping the most recent in the left most part of the range.
Thank you in advance.
Private Sub Worksheet_Calculate()
Dim Over As Range
Dim msb As Integer
Application.EnableEvents = False
For Each Over In Range("$G$3")
If Over.Value > 0 Then
With ThisWorkbook.Names("list1").RefersToRange.CurrentRegion
With .Offset(.Rows.Count, 0).Resize(1, 1)
.Value = Now
.Offset(0, 1).Value = Over.Value
End With
End With
End If
Application.EnableEvents = True
Next
End Sub
Works nicely but I want my list to fill horizontally not vertically. Can the new data be added from left to right?
Keeping the most recent in the left most part of the range.
Thank you in advance.
Private Sub Worksheet_Calculate()
Dim Over As Range
Dim msb As Integer
Application.EnableEvents = False
For Each Over In Range("$G$3")
If Over.Value > 0 Then
With ThisWorkbook.Names("list1").RefersToRange.CurrentRegion
With .Offset(.Rows.Count, 0).Resize(1, 1)
.Value = Now
.Offset(0, 1).Value = Over.Value
End With
End With
End If
Application.EnableEvents = True
Next
End Sub