Question : Find first empty cell in column and then copy the value of another cell across.

Hello and Happy New Year,

I am trying to produce a chart showing share prices during the day. I therefore need to produce a column of all the prices during the day.
I have successfully setup the spreadsheet to download the share price every minute and put it in cell J1. This works fine.
I want to take this value and put it into the first empty cell in column K and continue doing this for the whole day so I get column K with about 500 values in it. I will then use these values to draw the chart.

I have setup

Private Sub Worksheet_Calculate()
MACRO1
End Sub

to run MACRO1 when the spreadsheet auto-updates every minute.

I just need help on the last difficult part to find the empty cell and copy the value across.
I would prefer that the highlighted cell did not move while this was happening. Ie: the process runs in the background as it were.

Thanks for your help.

Answer : Find first empty cell in column and then copy the value of another cell across.

something like this will populate the first balnk cell after the last used data point in K
1:
2:
3:
4:
5:
Sub B()
Dim mystr As String
mystr = "test"
Cells(Rows.Count, "K").End(xlUp).Offset(1, 0) = mystr
End Sub
Open in New Window Select All
Random Solutions  
 
programming4us programming4us