vba and excel question

Stclements1

Board Regular
Joined
Sep 15, 2018
Messages
150
Office Version
  1. 365
Platform
  1. Windows
I am not sure what the protocol on this site in terms of asking questions and how many per thread. I have two questions and if I have broken protocol then I apologise and if informed so will send a new thread with the seond question.
Q1 In cell E3 I have this code =IF(C2>0;D2+F2;TODAY()), Cell C2 has a value of 0 or 1, 0 meaning that the trade is open and 1 meaning it's closed. D2 is the date that determines the start date of a trade, and F2 calculates the differnec between the start date and the todays date, but when the value in C2 becomes 1 I want E2 to stop counting todays date and display the date at the point C2 changed value from 0 to 1. The code above doesn't seem to work.

Q2 If I have a spreadsheet that is ultimatley a monthly template that has multiple formulas and text data is it possible to somehow copy the spreadsheet data into a VBA module so it effectively writes the source code so that I have a macro that each month I can open a blank spreadsheet and just run the recorded macro, or do I have to input all the active cells and ranges individually?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
=IF(C2>0,D2+F2,TODAY()) why do you have semi colons? you need to have commas
 
Upvote 0
Formulas only work on this Dell laptop when using semi colons. Apparently its a common issue.
 
Upvote 0
=IF(C2>0,D2+F2,TODAY()) why do you have semi colons? you need to have commas
It depends on your Regional Settings. Some places use semi-colons instead of commas. Perfectly valid, if that is how you Regional Settings are set.

The following articles explain it in more detail, and show you where that Regional Setting is, should you ever want to change it.
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,639
Members
449,093
Latest member
Ahmad123098

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