I have a Excel spreadsheet that is linked to another program and
displaying a value from the linked db in the first cell of the
spreadsheet. What I would like to do is capture the value of the first
cell as it changes and copy to the next available empty cell in the
row. Something like this example below.

Initial value shows:
Col1 Col2 Col3
53

when the value changes the first time do this:
Col1 Col2 Col3
54 53

when the value changes again do this:
Col1 Col2 Col3
55 53 54

And so on.....

Any help would be greatly appreciated.

RE: Copy the value to the next open cell when the original cell change by Wigi

Wigi
Wed Jul 23 14:34:01 CDT 2008

Something in this spirit:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address = "$A$1" Then
Application.EnableEvents = False
Cells(1, Columns.Count).End(xlToLeft).Offset(, 1).Value = Target.Value
Application.EnableEvents = False
End If

End Sub



--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"gaburcham@gmail.com" wrote:

> I have a Excel spreadsheet that is linked to another program and
> displaying a value from the linked db in the first cell of the
> spreadsheet. What I would like to do is capture the value of the first
> cell as it changes and copy to the next available empty cell in the
> row. Something like this example below.
>
> Initial value shows:
> Col1 Col2 Col3
> 53
>
> when the value changes the first time do this:
> Col1 Col2 Col3
> 54 53
>
> when the value changes again do this:
> Col1 Col2 Col3
> 55 53 54
>
> And so on.....
>
> Any help would be greatly appreciated.
>