![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 25
|
This code takes the highest incrementing value from J4 and moves it to F4 when J4 is reset to 0. Then when the next highest value is sent to F4 the cells are shifted down.
My problem is i need to link J4 to A1 with the formula in cell J4 =A1 The code works until i link J4 to A1. J4 has to be linked to A1 because im using a DDE link in A1 for the incrementing value I also tried it just typing the value in A1 and removing the DDE link...Any Ideas???? Public lstValue Public OldValueInF5 -------------------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row = 4 And Target.Column = 10 Then If Target.Value < 1 Then Range("F4").Value = lstValue lstValue = Target.Value If Range("F4") > Range("J4") Then Range("f4").Insert Shift:=xlDown If Range("F5") > 0 Then Range("E4").Value = Format(Now, "DD-MMM-YY HH:MM:SS") If Range("F5") <> OldValueInF5 Then Range("E4").Insert Shift:=xlDown OldValueInF5 = ("F5") End If End If End If End If End Sub [ This Message was edited by: mcleve on 2002-05-18 08:22 ] [ This Message was edited by: mcleve on 2002-05-19 19:24 ] |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi
I can't figure out what the code is doing exactly??? Did the original code work? Tom |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Sorry but i just couldn't get the code to run ! Even with the variable "lstValue" set as "public" it was always 0 when I would fire the macro.
[ This Message was edited by: Nimrod on 2002-05-18 10:44 ] |
|
|
|
|
|
#4 |
|
New Member
Join Date: May 2002
Posts: 25
|
Tom,
The original code works. I E-mailed you the Workbook. Thanks Again |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|