VBA code to populate a table depending on values in another table

Andrevictor

New Member
Joined
May 5, 2021
Messages
10
Office Version
  1. 2019
Platform
  1. Windows
Greetings to Superbrain. Please advise on the suitable VBA code. I have two tables. One (three colums) contains values TRUE / FALSE - results of status of checkboxes. Another column contains text and the third - numerical values. I want the code to go through the first table looking for TRUE value. When found, values in two adjacent cells of the same row ("Document #" and "$xxx") to be copied and placed to the uppermost empty row of the destination table. The aim is to populate the destination table only with selected (TRUE) values and leave no empty rows. Thank you in advance.
Capture.JPG
 
Other ways exist when the data does not respect Excel rules …​
Attach at least the before state and the expected result, better to help than any screenshot …​
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Your subject Title says:

VBA code to populate a table depending on values in another table​

But then you said forget the Table it's not a Table
 
Upvote 0
Needs only 2 codelines with smart ranges with headers but it seems headers are missing ?​
Hi. My ranges are with fixed number of rows and colums. I cannot use "dynamic ranges". I can figure out how to VLOOKUP for certain value and copy Offset cell value to another place. My problem is that I do not want empty rows in the destination range. All new data must go to the uppermost empty row in the destination range. Please help.
 
Upvote 0
Other ways exist when the data does not respect Excel rules …​
Attach at least the before state and the expected result, better to help than any screenshot …​
Befre state: the source range is populated with TRUE/FALSE values assigned. The destination range is empty. After VBA code is executed, the values in two left columns of the source range that correspond to TRUE are copied and pasted to the destonation range row by row beginning from the top without leaving emty rows.
 
Upvote 0
Your subject Title says:

VBA code to populate a table depending on values in another table​

But then you said forget the Table it's not a Table
I called this a Table with the same meaning as a table in the paper book. It is not a "table" in Excel terms. These are just ranges of cells. I can rename the Worksheet: Master, if this helps.
 
Upvote 0
I called this a Table with the same meaning as a table in the paper book. It is not a "table" in Excel terms. These are just ranges of cells. I can rename the Worksheet: Master, if this helps.
table in the paper book
Paper book???
What is a paper book ?
 
Upvote 0
Other ways exist when the data does not respect Excel rules …​
Attach at least the before state and the expected result, better to help than any screenshot …​
Here is a screen capture of my actual work sheet. I do not want emty rows in the quotation area on the right.

Capture3.jpg
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,732
Members
449,093
Latest member
Mnur

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