Copy the value to the next open cell when the original cell changes

G

gaburcham

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.
 
W

Wigi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top