VBA code to keep data in parity between two worksheets

SamCha

New Member
Joined
Nov 23, 2020
Messages
30
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I am new to VBA and I am searching for an easy code to connect my data flow in 2 worksheets in the same macro workbook. One worksheet is the "Input" worksheet (Sheet 1) and the other is "Format" worksheet (Sheet 2). Manually data are entered in Sheet 1. Column B (Data starts from Row 15) in Sheet 1 is the main column where account numbers are entered. Rest of the cells are either connected to this account with vlookup or is REF cell. Column D in Sheet 2 is the REF column of Column B in Sheet 1. So both the column has the account numbers. Now what is required is if there is no account number in Sheet 1 in column B, that means no account number in Sheet 2 in column D - the entire row in Sheet 2 will be removed and if there is an account number the entire row will automatically be filled taking reference of the previous row. In Sheet 1 the account number entries vary (starting from Row 15) - sometimes being 20 entries and sometimes 5. Entry starts in Sheet 2 from Row 5. Range of data in Sheet 2 is from A1:DJ. If we have an account number in Column D - the entire range from A:DJ will be populated take ref from the row above and will be blank if Column D is blank
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi all,

Just to add to what I am looking for please refer to the Sheet 1 attached. I am not able to attach the Sheet 2. But what I meant was Sheet 1 and Sheet 2 have cell reference. Column B (starting from Row 15) in Sheet 1 is cell reference for Column D in Sheet 2 (Starting from Row 5). The size of the Debit account varies in Sheet 1. I am trying to find a solution that when there is no account number in a row in Sheet 1, the entire row in Sheet 2 will be deleted, and when there is an account number the entire row will take the formula reference in increasing order from row above. Hope I am able to explain.

Thanks in advance.
 

Attachments

  • Sheet 1.PNG
    Sheet 1.PNG
    37.6 KB · Views: 1
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,755
Members
449,049
Latest member
excelknuckles

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