Macro extract data sheet2 based on background yellow color

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,102
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hello expert..
i am looking some macro code to extract data based on background color (yellow color) from sheet1 to sheet2
for detail like this below :
<style type="text/css">
table.tableizer-table {
border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
font-size: 12px;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #ccc;
}
.tableizer-table th {
background-color: #104E8B;
color: #FFF;
font-weight: bold;
}
</style><table class="tableizer-table">
<tr class="tableizer-firstrow"><th>sheet1</th><th> </th><th> </th><th> </th><th> </th></tr>
<tr><td> </td><td>before macro</td><td> </td><td> </td><td> </td></tr>
<tr><td>no</td><td>name</td><td>gender</td><td>place</td><td>date</td></tr>
<tr><td>1</td><td>ABDUL RAHMAN GAZI</td><td>L</td><td>PEKANBARU</td><td>15/04/2009</td></tr>
<tr><td>2</td><td>ABIYEZA L AWALI KENCANA</td><td>L</td><td>JAKARTA</td><td>07/06/2008</td></tr>
<tr><td>3</td><td>ADINDA LATHIFA MAHESWARI</td><td>P</td><td>PEKANBARU</td><td>17/03/2009</td></tr>
<tr><td>4</td><td>AFIFAH CHAIRUNNISA</td><td>P</td><td>PEKANBARU</td><td>23/07/2009</td></tr>
<tr><td>5</td><td>AFRAIZZATUN NISSA</td><td>P</td><td>PEKANBARU</td><td>14/01/2010</td></tr>
<tr><td>6</td><td>AHMAD LUTHFI</td><td>L</td><td>PEKANBARU</td><td>18/01/2009</td></tr>
<tr><td>7</td><td>AISYAH HALIMAH SIMBOLON</td><td>P</td><td>PEKANBARU</td><td>05/01/2009</td></tr>
<tr><td>8</td><td>AKBAR MULYA ISKANDAR S</td><td>L</td><td>PEKANBARU</td><td>12/11/2008</td></tr>
<tr><td>9</td><td>ALBY SYAROH</td><td>P</td><td>KAMPAR</td><td>27/07/2009</td></tr>
<tr><td>10</td><td>ALDILA OCTAVIA YONI</td><td>P</td><td>PEKANBARU</td><td>29/10/2009</td></tr>
<tr><td>11</td><td>ALIFIA HUMAIRA</td><td>P</td><td>PEKANBARU</td><td>26/07/2009</td></tr>
<tr><td>12</td><td>ANGGUN SABRINA</td><td>P</td><td>PEKANBARU</td><td>29/01/2009</td></tr>
<tr><td>13</td><td>APIS</td><td>P</td><td>PEKANBARU</td><td>29/01/2009</td></tr>
<tr><td>14</td><td>ARSYAULIA HALIMAH</td><td>P</td><td>PEKANBARU</td><td>09/07/2009</td></tr>
<tr><td>15</td><td>ATIKAH PUTRI ANDINI</td><td>P</td><td>PEKANBARU</td><td>28/01/2010</td></tr>
<tr><td>16</td><td>AULIA FADILA SUFI</td><td>P</td><td>PEKANBARU</td><td>25/07/2010</td></tr>
<tr><td>17</td><td>AULIA PUTRI</td><td>P</td><td>PEKANBARU</td><td>08/02/2009</td></tr>
<tr><td>18</td><td>BINTANG AULIA RIZKULLAH</td><td>L</td><td>PEKANBARU</td><td>18/07/2008</td></tr>
<tr><td>19</td><td>BRAMAZANI MUHAMMAD MULYA ARROZAQ</td><td>L</td><td>PEKANBARU</td><td>08/07/2009</td></tr>
<tr><td>20</td><td>CHAVIA SALWA SALSABILA</td><td>P</td><td>PEKANBARU</td><td>28/04/2009</td></tr>
<tr><td>21</td><td>DEAN ALVANO ZAGHLUL</td><td>L</td><td>PEKANBARU</td><td>06/04/2009</td></tr>
<tr><td>22</td><td>FAHRI BINTANG PRATAMA</td><td>L</td><td>PEKANBARU</td><td>25/01/2010</td></tr>
<tr><td>23</td><td>FAIDAH MARSYA NUSAIBAH GUSTINO</td><td>P</td><td>KEBUMEN</td><td>19/02/2009</td></tr>
<tr><td>24</td><td>FAJRUL MUSLIM RAHMAN</td><td>L</td><td>PEKANBARU</td><td>19/12/2008</td></tr>
<tr><td>25</td><td>FAREL NAUFAL AZIZ</td><td>L</td><td>BANDUNG</td><td>09/09/2009</td></tr>
<tr><td>26</td><td>FATIH RIZKYA ANHAR</td><td>L</td><td>PEKANBARU</td><td>10/02/2009</td></tr>
<tr><td>27</td><td>FATURRAHMAN </td><td>L</td><td>PEKANBARU</td><td>18/02/2009</td></tr>
<tr><td>28</td><td>FAWWAS BAYANAKA</td><td>L</td><td>PEKANBARU</td><td>21/09/2009</td></tr>
<tr><td>29</td><td>HAIFANA</td><td>P</td><td>PEKANBARU</td><td>29/07/2009</td></tr>
<tr><td>30</td><td>HARUN AL RASYID</td><td>L</td><td>PEKANBARU</td><td>01/05/2010</td></tr>
<tr><td>31</td><td>KHAIRUNNISA SALSABILA</td><td>P</td><td>PEKANBARU</td><td>16/08/2009</td></tr>
<tr><td>32</td><td>M.ALDIANSYAH</td><td>L</td><td>PEKANBARU</td><td>05/12/2009</td></tr>
<tr><td>33</td><td>M.ANDRA PRASETYO</td><td>L</td><td>PEKANBARU</td><td>27/05/2008</td></tr>
<tr><td>34</td><td>M.DZAKI AL FAUZAN</td><td>L</td><td>PEKANBARU</td><td>07/03/2008</td></tr>
<tr><td>35</td><td>M.FARRELSYAH AKBAR PUTRA RANJAYA</td><td>L</td><td>PEKANBARU</td><td>21/11/2010</td></tr>
<tr><td>36</td><td>M.HABIB AKASALI</td><td>L</td><td>PEKANBARU</td><td>21/11/2008</td></tr>
<tr><td>37</td><td>M.NAUFAL </td><td>L</td><td>TERATAK BULUH</td><td>14/12/2009</td></tr>
<tr><td>38</td><td>M.RAFQA MALIK DANIS</td><td>L</td><td>PEKANBARU</td><td>02/06/2009</td></tr>
<tr><td>39</td><td>MOZA KANIA EDWINA</td><td>P</td><td>PEKANBARU</td><td>16/03/2009</td></tr>
<tr><td>40</td><td>MUTHIARA HABIBTI HAMDANI</td><td>P</td><td>PEKANBARU</td><td>01/02/2010</td></tr>
<tr><td>41</td><td>MUTIA IRSYA SABILA</td><td>P</td><td>PEKANBARU</td><td>28/02/2008</td></tr>
<tr><td>42</td><td>NAJWA DWI KHAIRUNNISA</td><td>P</td><td>DUMAI</td><td>25/03/2009</td></tr>
<tr><td>43</td><td>NIDA FATHIYANNISA</td><td>P</td><td>PEKANBARU</td><td>23/01/2010</td></tr>
<tr><td>44</td><td>QEYLLA PUTRI ALIFA</td><td>P</td><td>PEKANBARU</td><td>19/05/2009</td></tr>
<tr><td>45</td><td>RAFI SAPUTRA</td><td>L</td><td>PEKANBARU</td><td>10/01/2009</td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>sheet2</td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td>after macro</td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>6</td><td>AHMAD LUTHFI</td><td>L</td><td>PEKANBARU</td><td>18/01/2009</td></tr>
<tr><td>13</td><td>APIS</td><td>P</td><td>PEKANBARU</td><td>29/01/2009</td></tr>
<tr><td>14</td><td>ARSYAULIA HALIMAH</td><td>P</td><td>PEKANBARU</td><td>09/07/2009</td></tr>
<tr><td>24</td><td>FAJRUL MUSLIM RAHMAN</td><td>L</td><td>PEKANBARU</td><td>19/12/2008</td></tr>
<tr><td>25</td><td>FAREL NAUFAL AZIZ</td><td>L</td><td>BANDUNG</td><td>09/09/2009</td></tr>
<tr><td>39</td><td>MOZA KANIA EDWINA</td><td>P</td><td>PEKANBARU</td><td>16/03/2009</td></tr>
<tr><td>40</td><td>MUTHIARA HABIBTI HAMDANI</td><td>P</td><td>PEKANBARU</td><td>01/02/2010</td></tr>
<tr><td>44</td><td>QEYLLA PUTRI ALIFA</td><td>P</td><td>PEKANBARU</td><td>19/05/2009</td></tr>
</table>
any assistance would be greatly appreciated..

regard..

m.susanto
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
from start name :
<style type="text/css">
table.tableizer-table {
border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif
font-size: 12px;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #ccc;
}
.tableizer-table th {
background-color: #104E8B;
color: #FFF;
font-weight: bold;
}
</style><table class="tableizer-table">
<tr class="tableizer-firstrow"><th>no</th><th>name</th><th>gender</th><th>place</th><th>date</th></tr>
<tr><td>6</td><td>AHMAD LUTHFI</td><td>L</td><td>PEKANBARU</td><td>18/01/2009</td></tr>
<tr><td>13</td><td>APIS</td><td>P</td><td>PEKANBARU</td><td>29/01/2009</td></tr>
<tr><td>14</td><td>ARSYAULIA HALIMAH</td><td>P</td><td>PEKANBARU</td><td>09/07/2009</td></tr>
<tr><td>24</td><td>FAJRUL MUSLIM RAHMAN</td><td>L</td><td>PEKANBARU</td><td>19/12/2008</td></tr>
<tr><td>25</td><td>FAREL NAUFAL AZIZ</td><td>L</td><td>BANDUNG</td><td>09/09/2009</td></tr>
<tr><td>39</td><td>MOZA KANIA EDWINA</td><td>P</td><td>PEKANBARU</td><td>16/03/2009</td></tr>
<tr><td>40</td><td>MUTHIARA HABIBTI HAMDANI</td><td>P</td><td>PEKANBARU</td><td>01/02/2010</td></tr>
<tr><td>44</td><td>QEYLLA PUTRI ALIFA</td><td>P</td><td>PEKANBARU</td><td>19/05/2009</td></tr>
</table>


they have highlighted background yellow color before it (in sheet1)

 
Upvote 0
Your example chart does not show any color in it. Which column (or maybe columns) will have the yellow color color? More importantly, how did the color get into the cells... was it manually placed in the cell or is it there from Conditonal Formatting?
 
Upvote 0
hi Rick, in OP#1 in column b (name column) following name this below should be/have highlighted background yellow color :(as my first question in sheet1)

AHMAD LUTHFI
APIS
ARSYAULIA HALIMAH
FAJRUL MUSLIM RAHMAN
FAREL NAUFAL AZIZ
MOZA KANIA EDWINA
MUTHIARA HABIBTI HAMDANI
QEYLLA PUTRI ALIFA
 
Upvote 0
hi Rick, in OP#1 in column b (name column) following name this below should be/have highlighted background yellow color :(as my first question in sheet1)
But you did not answer my other question... how did the yellow color get into the cells? Was it manually put there or is it there from Conditional Formatting? If by Conditional Formatting, what was the condition?
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

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