I am very new to VBA and am teaching myself as I go. The one thing I need but cannot figure out is:
I have a spreadsheet. Each day user fills out a userform to input data as needed (around 50 inputs). The code once the user clicks "Submit" on the userform takes all of that data and places it into the FirstBlankRow in the data's corresponding columns. It also puts a date time stamp in column A of when the "Submit" button was clicked. In a sense, each row is a new day of data.
I need the code to be able to look at the sales from one month ago and compare that to today's sales. However, since different months have differing number of days, it is not as easy as an offset by -30 etc. If today is june 3, I need it to know to go back to may 3.
I have no idea how I would even begin to code this
Simplified Example:
Date DailySales +/-Day
5/1 367.42 24.08
5/2 501.89 104.94
5/3 445.23 -11.54
...
...
...
...
6/1 409.87 42.45
6/2 498.01 -3.89
6/3 527.17 81.94
where the sales from 6/2 is compared to 5/2 and the difference is placed in the row for 6/2 in column C
I have a spreadsheet. Each day user fills out a userform to input data as needed (around 50 inputs). The code once the user clicks "Submit" on the userform takes all of that data and places it into the FirstBlankRow in the data's corresponding columns. It also puts a date time stamp in column A of when the "Submit" button was clicked. In a sense, each row is a new day of data.
I need the code to be able to look at the sales from one month ago and compare that to today's sales. However, since different months have differing number of days, it is not as easy as an offset by -30 etc. If today is june 3, I need it to know to go back to may 3.
I have no idea how I would even begin to code this
Simplified Example:
Date DailySales +/-Day
5/1 367.42 24.08
5/2 501.89 104.94
5/3 445.23 -11.54
...
...
...
...
6/1 409.87 42.45
6/2 498.01 -3.89
6/3 527.17 81.94
where the sales from 6/2 is compared to 5/2 and the difference is placed in the row for 6/2 in column C