Copying Data from other workbook and pasting in new workbook depending on Month input

whiskey_pickle

New Member
Joined
Mar 11, 2019
Messages
3
Hello!

I am not versed in VBA whatsoever, and have a daunting task.

I have a brief (Workbook A) that I update every week from a report that's generated and sent to me (Workbook B). Usually I just copy the data I need from Worksheet B into Worksheet A but my superiors want a code that automatically generates it.

So here it is, my SOS:

I need help with having a tab in Workbook A that I click a "Run Report" button that prompts me to enter in the month I want to update, link/upload Worksheet B and then it pastes the Obligations and Expenditures into another tab in Workbook A. That tab in workbook A basically mirrors Worksheet B's tab except it only contains the 2 types of data I need for each month.


Thank you in advance everyone for anything and everything you may provide!

Supporting Links:

Workbook B: Report that I want to link/upload the first tab to Workbook A
https://imgur.com/DGyVgFZ

Workbook A Tab that is populated by Workbook B:
https://imgur.com/tWeB6D2
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Thank you for your response!

In short, no. I would only want the data in "Gross Obs" and "Expenditure" Columns (Columns H and I) from Worksheet B to be copied over to Worksheet A in the month that was specified by the input prompt. I hope this answers your question! Please let me know if you need more information.
 
Upvote 0
if you make sheet2 cell A1 =[workbook B]sheet1!A1 and copy down and across sheet 2 is then a copy of workbook B

then this macro, written and run from sheet2 of workbook A will grab the correct data and put it in sheet1 of workbook A for you

Sub Macro4()
'
' Macro4 Macro
' Macro recorded 12/03/2019 by bob
'


'
Dim obs(100), expend(100)
For j = 5 To 100
If Cells(j, 1) = Cells(1, 6) Then Sum = Sum + 1: obs(Sum) = Cells(j, 4): expend(Sum) = Cells(j, 6)
Next j
Sheets(1).Select
For k = 1 To Sum
Cells(k, 1) = obs(Sum): Cells(k, 2) = expend(Sum)
Next k
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,543
Members
449,089
Latest member
davidcom

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