Macro to copy and paste into table skipping blank cells

roboco

New Member
Joined
Jan 11, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

I would like to create a code that copys the non blank values from column A while meeting a value in column b and then adding it to a table

So for example if
A1 has text and b1 value = 1 then add a1 to table1
a2 is blank and b2 value =1 then skip
if a3 has text and b3 value=2 then add a3 to table2
And so on.

something like range("a:a") >="" and range("b:b") = 1 then add the values that meet the criteria to table1

If range("a:a") >="" and range("b:b") = 2 then add the values that meet the criteria to table2

If range("a:a") >="" and range("b:b") = 3 then add the values that meet the criteria to table3

If range("a:a") >="" and range("b:b") = 4 then add the values that meet the criteria to table4

Roboco
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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