Hi, I want the macro to check if a column in a defined table has values and, in this case, copy it and overwrite another column of the same table.
I have developed a solution, which is apparently correct (no errors appear) but runs the macro regardles if it has values or not.
- Sub CopyPasteIfEmpty()
- Sheets("Sheet 1").Activate
- If Not IsEmpty("Sheet 1[Column to be copied]") Then
- Range("Sheet 1[Column to be copied]").Copy[INDENT]Range("Sheet 1[Column to be overwritten]").Select
- Selection.PasteSpecial Paste:=xlPasteValues, Operation:?xlNone, SkipBlanks:=False, Transpose:=False
- Range("Sheet 1[Column to be copied]".ClearContents[/INDENT]
- End if
The thing is that this is part of a bigger macro which i run to clean the excel from the data of the last time i used it (to audit). So if the column "Column to be copied" has no values, the macro would overwrite the values of the "Column to be overwritten" column with no values (wich is annoying to say the least).
Thanks in advance, and excuse me if i made any mistakes, as i am new to this forum.