PC Review


Reply
Thread Tools Rate Thread

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

 
 
gaburcham@gmail.com
Guest
Posts: n/a
 
      23rd Jul 2008
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.
 
Reply With Quote
 
 
 
 
Wigi
Guest
Posts: n/a
 
      23rd Jul 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


"(E-Mail Removed)" 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.
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Microsoft Excel Misc 0 29th Jun 2009 11:20 AM
Copy rows but need to refer to same cell in original formula addison Microsoft Excel Worksheet Functions 4 4th Apr 2008 04:29 PM
I copy a formula and the results copy from the original cell =?Utf-8?B?YnJvb2tseW5zZA==?= Microsoft Excel Misc 1 23rd Jun 2007 01:35 AM
How can I copy many formulas and keep original cell location? =?Utf-8?B?TGluZGEgT3o=?= Microsoft Excel Misc 3 5th Oct 2006 08:31 AM
Copy formulas and maintain original cell references? bostitch Microsoft Excel Misc 4 25th Sep 2003 06:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:01 PM.