rwmill9716
Active Member
- Joined
- May 20, 2006
- Messages
- 493
- Office Version
- 2013
- Platform
- Windows
This code takes the value in Cell N2 and writes it to Column S after the last value in that column. I've put a loop into the code to try to get 1,000 values in column S, but what's happening is that it doesn't stop at 1,000 it just keeps pouring data into Column S. I need code that will limit the data in column S to 1,000 values.
Thanks,
Ric Miller
<Code>Private Sub Worksheet_Calculate()
Application.EnableEvents = False
N = 0
Do Until N = 1000
N = N + 1
Range("S" & Rows.Count).End(xlUp).Offset(1) = Range("N2").Value
Application.EnableEvents = True
Loop
End Sub
</Code>
Thanks,
Ric Miller
<Code>Private Sub Worksheet_Calculate()
Application.EnableEvents = False
N = 0
Do Until N = 1000
N = N + 1
Range("S" & Rows.Count).End(xlUp).Offset(1) = Range("N2").Value
Application.EnableEvents = True
Loop
End Sub
</Code>