TheresaMaybeImaFruitcake
New Member
- Joined
- Aug 13, 2017
- Messages
- 3
Hi all,
My title covers the reasonably well. I'm working on an end-to-end index, my first real attempt to do this myself - I've frankensteined in an excellent little bit of code which stores the values that my index outputs at each time interval. Trouble is, it only likes to run the process when I manually input the figure. So the code is supposed to store the value from the cell it references (in my case, C6) starting a few cells below, again and again, so I can use them later, in a list. All this works a treat if I type in my figure but it all goes horribly wrong if I: reference the C6 input it to another cell, give C6 any sort of formula, etc.
I've tried every form of excel recalculation (from hotkeys to automatic recalculation) to force it to accept C6's formula as a legitimate value for the code to store. The first time I reference another cell it does work, then it refuses to update my list with the new reference value(s) in C6.. I've narrowed it down to an issue with my code. Can anyone help? I've got a pretty hopeless grasp of VBE, never really having needed to use it before.
Code is below:
Any help would be very much appreciated.
Thanks very much!
My title covers the reasonably well. I'm working on an end-to-end index, my first real attempt to do this myself - I've frankensteined in an excellent little bit of code which stores the values that my index outputs at each time interval. Trouble is, it only likes to run the process when I manually input the figure. So the code is supposed to store the value from the cell it references (in my case, C6) starting a few cells below, again and again, so I can use them later, in a list. All this works a treat if I type in my figure but it all goes horribly wrong if I: reference the C6 input it to another cell, give C6 any sort of formula, etc.
I've tried every form of excel recalculation (from hotkeys to automatic recalculation) to force it to accept C6's formula as a legitimate value for the code to store. The first time I reference another cell it does work, then it refuses to update my list with the new reference value(s) in C6.. I've narrowed it down to an issue with my code. Can anyone help? I've got a pretty hopeless grasp of VBE, never really having needed to use it before.
Code is below:
Code:
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=000000]#000000[/URL] ; background-color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffffff]#ffffff[/URL] }p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=011993]#011993[/URL] ; background-color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffffff]#ffffff[/URL] }p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; background-color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffffff]#ffffff[/URL] ; min-height: 13.0px}p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=008f00]#008f00[/URL] ; background-color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=ffffff]#ffffff[/URL] }span.s1 {color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=011993]#011993[/URL] }span.s2 {color: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=000000]#000000[/URL] }</style>Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
i = 10
'If there is a change to C6
If Target.Address = ActiveSheet.Range("C6").Address Then
Do Until ActiveSheet.Cells(i, 3).Value = vbNullString
i = i + 1
Loop
ActiveSheet.Cells(i, 3).Resize(, 1).Value = ActiveSheet.Range("C6:C7").Value
End If
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=011993]#011993[/URL] ][FONT=Menlo]End[/FONT][/COLOR][FONT=Menlo] [/FONT][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=011993]#011993[/URL] ][FONT=Menlo]Sub[/FONT][/COLOR]
Any help would be very much appreciated.
Thanks very much!