vendredi 30 juillet 2021

If cell is empty, paste, Else, go to next blank cell and paste

Basically I just need excel to verify if Cell A1 is empty.

If A1 is empty, paste starting in A1. If A1 is not empty, go down to the next blank cell in Column A, and paste there.

I am receiving an error : Application-defined or object-defined error on the Else part of the code.

If IsEmpty("A1") Then
    Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
Else
    Range("A1").End(xlDown).Offset(1, 0).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
End If

Aucun commentaire:

Enregistrer un commentaire