Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Column Offset Update

Hi
I have a cell with a DDE link from another program, which is sample data I
need to record.
To do this I need to copy the value of the cell, A1, and paste it into B1,
when the cell value changes I need to copy the new value from A1 into B2 and
so on. I can then produce a real time graph from the information in column B.

Any Ideas
Thanks
Alec

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Column Offset Update

Try this worksheet event code...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Long, LR As Long
If Target.Address(0, 0) = "A1" Then
LR = Cells(Rows.Count, "B").End(xlUp).Row
If Not (LR = 1 And Len(Cells(LR, "B").Value) = 0) Then LR = LR + 1
Application.EnableEvents = False
Cells(LR, "B").Value = Range("A1").Value
Application.EnableEvents = True
End If
End Sub

To install it, right click the tab at the bottom of the worksheet where you
want this functionality, select View Code from the popup menu and then
copy/paste the above code into the code window that appeared.

--
Rick (MVP - Excel)


"Alectrical" wrote in message
...
Hi
I have a cell with a DDE link from another program, which is sample data I
need to record.
To do this I need to copy the value of the cell, A1, and paste it into B1,
when the cell value changes I need to copy the new value from A1 into B2
and
so on. I can then produce a real time graph from the information in column
B.

Any Ideas
Thanks
Alec


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Column Offset Update

Thanks Rick
That works a treat

"Alectrical" wrote:

Hi
I have a cell with a DDE link from another program, which is sample data I
need to record.
To do this I need to copy the value of the cell, A1, and paste it into B1,
when the cell value changes I need to copy the new value from A1 into B2 and
so on. I can then produce a real time graph from the information in column B.

Any Ideas
Thanks
Alec

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Column Offset Update

Hi Rick

Just realised, the code only works if I change the value in A1 and then
press enter, It does not work with a link that updates every second.

"Rick Rothstein" wrote:

Try this worksheet event code...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Long, LR As Long
If Target.Address(0, 0) = "A1" Then
LR = Cells(Rows.Count, "B").End(xlUp).Row
If Not (LR = 1 And Len(Cells(LR, "B").Value) = 0) Then LR = LR + 1
Application.EnableEvents = False
Cells(LR, "B").Value = Range("A1").Value
Application.EnableEvents = True
End If
End Sub

To install it, right click the tab at the bottom of the worksheet where you
want this functionality, select View Code from the popup menu and then
copy/paste the above code into the code window that appeared.

--
Rick (MVP - Excel)


"Alectrical" wrote in message
...
Hi
I have a cell with a DDE link from another program, which is sample data I
need to record.
To do this I need to copy the value of the cell, A1, and paste it into B1,
when the cell value changes I need to copy the new value from A1 into B2
and
so on. I can then produce a real time graph from the information in column
B.

Any Ideas
Thanks
Alec



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
OFFSET COLUMN() ROW() - what does this mean? foxyfmu Excel Worksheet Functions 1 December 21st 10 09:38 PM
Column Offset Kirill V Excel Programming 3 March 11th 09 02:23 PM
offset row not column Atishoo Excel Programming 5 July 18th 08 11:30 PM
Offset from a variable column to a fixed column Kurt Barr Excel Programming 2 June 27th 06 05:45 PM
offset every nth column Sampson Excel Worksheet Functions 2 February 27th 05 06:07 PM


All times are GMT +1. The time now is 11:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"