Automatically transfer data from one sheet to another in the next available row with VBA code

atari

New Member
Joined
Jan 29, 2021
Messages
31
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. MacOS
I need help!! I am awesome at formulas but I am still not familiar with VBA language. I need some help building a code that will automatically move certain data to another tab once something is added into a specific cell.

In my sheet, data will be entered in columns B and C in several sections on the Budget tab. I would like to be able to have people mark "Yes" into column D to "Add to 5-Yr Budget?", then have the data in B-C automatically move over to the next available row in the corresponding section on the "5-Year" tab. Please let me know if you need to see the actual Excel sheet.

I cannot seem to be able to upload an image of the tabs I am working in. It keeps telling me the file is too big even when I save as JEPG or PNG. I wouldn't mind sending via private message if that's allowed. I would love to show the example of what I am trying to do.

Any help would be so much greatly appreciated!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Were you able to open the doc? Certainly not trying to rush you, just want to make sure you could view it.
 
Upvote 0
Sorry, I have been out of town. I will try to take a look at it this weekend.
 
Upvote 0
Back in post 16, you said this:
The 5-Year tab was a duplication of the Budget tab with additional columns added in so, yes the sections are identical on each tab.

But based on the sheet, you uploaded, this is NOT true.

On the Budget sheet, the first data entry row for each section follows this pattern:
17, 50, 83, 126, 159, ...

But on your 5-Year sheet, the first data entry row for each section follows this pattern:
17, 51, 85, 129, 163, ...

I wrote the code based on what you told me, that the two sheets followed the same pattern (were "duplicates" of one another).
If that is not, indeed, the case, my code won't work, and the task becomes a lot harder.
 
Upvote 0
That doesn't sound right at all... I have a meeting in a couple minutes but I will take a look here shortly to see why that may have happened. The rows should be identical.
 
Upvote 0
That doesn't sound right at all... I have a meeting in a couple minutes but I will take a look here shortly to see why that may have happened. The rows should be identical.
I am just going off of the workbook you uploaded in up in post 32.
You can clearly see that those two sheets are not identical. It seems that there is an extra header row added for each group after the first one.
That certainly would cause the code to not function properly, as it depends on matching rows on each sheet.
 
Upvote 0
Oh my gosh, I swear I'm not an idiot... I don't remember adding those lines. It must have been so I could add more totals on the 5-Year tab and still be able to have that "Picture" button to the right. I am so sorry to waste your time!! I removed the extra lines to make the tabs identical again, and it's working. Thank you again for all your help, I cannot tell you how huge this is. Thank you thank you!! (I feel so stupid :p )
 
Upvote 0

Forum statistics

Threads
1,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

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