macro put formula inside cell based on date of another cell

tonyjyoo

Board Regular
Joined
Aug 5, 2016
Messages
167
Hello,

I have a VBA macro which opens up a file with raw data. I want the next step to go back to my main workbook and enter a SUMIF formula in the corresponding cell based on the date in the cell above it.. for example column B would be 12/1/16, column C is 12/2/16, etc.

Is there a way to do this?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
How is the cell to put the formula in determined?

Is it based on something in the raw data file?
 
Upvote 0
Yes, there will be 4 separate companies with varying deposits/withdrawal amounts, and I would utilize a sumif formula to capture the sum of all the deposits/withdrawals for each company separately.

I know how to write VBA to input the formula in the cell, but don't know how to add to it so that it knows which cell to enter BASED off the dates above them. For example, if today's date (12/20/16) was in B1, tomorrows (12/21/16) would be B2, and so forth.
 
Upvote 0

Forum statistics

Threads
1,214,615
Messages
6,120,538
Members
448,970
Latest member
kennimack

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