Copy Data from another workbook with conditions.

SamarthSalunkhe

Board Regular
Joined
Jun 14, 2021
Messages
103
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

Suppose I have data in "3 Sheets" (Sheet1, Sheet2 and Sheet3) in each sheet there is data available in columns D, E & F, I am trying to import the above 3 sheet data in another standard "Workbook Sheets (Import)" column E, F & H. but in those "3 Sheets" column E cell value should be >0 and in D, E, F both 3 cell data should be available then only code will import that row data otherwise exclude and take next row data.

Also, data should be imported in alternate rows. (suppose 1Row= Header then imported data should be start pasted from Row2 then without disturbing Row3 second row of data should be pasted in row 4 (as Row3 have already data which should not disturb after data import))

For example.

Sheet1 Data

Ledger NameAmountNarration
500002 7251 Carriage-2021 Apr Local (BRMT - MUMBAI CFA) Transcold FR20210401
500002 7251 Carriage TDS-2021 Apr Local (Bajoria->Bangalore) Transcold FR20210402
500007 6012 Warehousing Cost18,200.002021 Apr Warehouse SDDPL FR20210403

Sheet2 Data

Ledger NameAmountNarration
200003 7111 Business Promotion Expenses2,75,000.00Apr'21 India Brand Health Tracker Market Vistas AP20210420CMI
200003 7111 Business Promotion Expenses-Apr'21 India REM Tracking Ipsos AP20210421CMI

Sheet3 Data

Ledger NameAmountNarration
100002 7111 GTN Off Invoice (TOT)-2021 Apr For Haiko Powai store Visibility-MT GN20210401
100002 7111 GTN Off Invoice (TOT)13,35,000.002021 Apr Off invoice discount at 1% of billing value (estimated at 2 lacs) Metro off inv GN20210402

and Requirement is.

LEDGERDEBITCREDITNARRATION
500007 6012 Warehousing Cost18,200.002021 Apr Warehouse SDDPL FR20210403
200003 7111 Business Promotion Expenses2,75,000.00Apr'21 India Brand Health Tracker Market Vistas AP20210420CMI
100002 7111 GTN Off Invoice (TOT)13,35,000.002021 Apr Off invoice discount at 1% of billing value (estimated at 2 lacs) Metro off inv GN20210402

I really appreciate it if someone helps me with this, as I am wasting a lot of time doing this manual work.

Thank you.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Its possible with a helper column and using if condition in macro.
 
Upvote 0
Kindly share sample that can be copied
HI @earthworm

I have saved files on the below path, where I have saved 2 files first one is "Accrual File" (this is my input file) I am getting details in 3 sheets and I have to import data of those rows only where the amount column value is more than zero also code should stop importing data before the last row that is "Total".

in the second "Required File" file I have taken data manually as per my requirement, where I have taken data in alternate rows and in other alternate row's there are formula's.


Macro Files - Google Drive

Thank you in advance.
 
Upvote 0

Forum statistics

Threads
1,214,374
Messages
6,119,155
Members
448,870
Latest member
max_pedreira

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