Hello,
I have a vba code that has to fill in certain cells on certain times. It works fine on a example file but not in this file, and I do not know why, can somebody please advice?
File included
Can you also upload example file as well? It'd make comparison easier.
My guess. In the example file, data isn't stored in table. If you check lastrow variable, it's at the end of the table and not last cell with data in the column.
Hello,Thank you your fast reply, you are right, the example is not in a table, is there a way to adjust the code or do i have to change the table setup
the sample included
Sure. You need to change the code to something like below. Using dotchie_945() as example.
Code:
Sub dotchie_945()
Dim lastrow As Long
lastrow = Sheets("Tijdenaantallen").Range("I:I").Find("*", _
SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Cells(lastrow + 1, "C").Value = Sheets("webquery_aantallen").Range("Y30").Value
End Sub