Hello,
this is my first post on the elektroda forum.
I'm just getting started with VBA and have a little problem.
The problem to be solved looks like this:
In my worksheet, I have such a series in column A. The value of each cell has no meaning.
I would like the macro to check if the cell is empty and if it is empty it will copy the previous value to the empty cell.
So far I have written such a macro but it doesn't work (I get error 400).
Unfortunately, the above code returns an error. Could any of the forum members give me advice on how to solve the above problem?
Thanks !
Peter.
this is my first post on the elektroda forum.
I'm just getting started with VBA and have a little problem.
The problem to be solved looks like this:
Kolumna
Wiersza
1 aaa
2 aaa
3 aaa
4
5 bbb
6 bbb
7 bbb
8
9 c
n+1
In my worksheet, I have such a series in column A. The value of each cell has no meaning.
I would like the macro to check if the cell is empty and if it is empty it will copy the previous value to the empty cell.
So far I have written such a macro but it doesn't work (I get error 400).
Sub Macro ()
FinalRow = Cells(Rows.Count, 1).End(x1Up).Row
i=1
For i=1 To FinalRow
If Cells(i,1).Value 0 Then
If Cells(i,1).Value=0 Then
Cells(i-1,1).Select
Selection.Copy
ActiveSheet.Paste
End If
End If
Next 1
End For
End Sub
Unfortunately, the above code returns an error. Could any of the forum members give me advice on how to solve the above problem?
Thanks !
Peter.