VBA - copy cell if it is not empty

Kristina96

New Member
Joined
Sep 30, 2019
Messages
33
Hi everyone,

I have the following problem:

I have a small table with 2 columns (E and F):
I want to copy all values from column F into column E but only if there is a value in column F. I cannot use the "normal" copy function as that would copy empty cells. There are values in column E that are supposed to be kept if there is no value in column F.
All of this should be done with VBA as it is part of a macro.
I am very thankful for every idea or help!
Thank you and regards
Kristina
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You're welcome, glad to help, & thanks for the feedback.:)
 
Upvote 0
That makes sense but it is still not copying the values. The macro is running without error but nothing changes...
That's odd, it worked just fine for me.
I have a feeling that there may be some minor detail that you are leaving out, not realizing that it may be affecting something.
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top