ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   POInv macro w/ if then statement (https://www.excelbanter.com/excel-programming/372005-poinv-macro-w-if-then-statement.html)

jatman

POInv macro w/ if then statement
 
i have a macro that runs when i press the big button (macro is in module).
macro does the following:
- saves a copy of the purchase order based on the po number and date stamp
- saves a copy on the hard drive
- emails a copy to accounts payable
- prints a copy for the actual invoice
- cleans the purchase order back to original state
- increases the po number by 1
- saves the new blank po

the date cell contains "[Ctrl] ;" - i want them to use that so the date is
entered in a preformatted condition and cannot be incorrect

i used the following code at the start of the macro
If .Range("M7") < "[Ctrl] ;" Then
with End If at the end of the macro, but it does not work.

is there any other way to enter the current date into the macro so that M7
self populates when the macro is run.

- the code =today() cannot be used because the copy stored on the hard drive
keeps updating itself when the file is opened.

regards

jat


Roger Govier

POInv macro w/ if then statement
 
Hi

You could use something like
Range("M7") = Format(date, "dd mmm yyyy")

Date in VBA will return the current date.

If you made your PO a Template, rather than a .xls file, you could save
yourself the task of

- cleans the purchase order back to original state
- saves the new blank po



--
Regards

Roger Govier


"jatman" wrote in message
...
i have a macro that runs when i press the big button (macro is in
module).
macro does the following:
- saves a copy of the purchase order based on the po number and date
stamp
- saves a copy on the hard drive
- emails a copy to accounts payable
- prints a copy for the actual invoice
- cleans the purchase order back to original state
- increases the po number by 1
- saves the new blank po

the date cell contains "[Ctrl] ;" - i want them to use that so the
date is
entered in a preformatted condition and cannot be incorrect

i used the following code at the start of the macro
If .Range("M7") < "[Ctrl] ;" Then
with End If at the end of the macro, but it does not work.

is there any other way to enter the current date into the macro so
that M7
self populates when the macro is run.

- the code =today() cannot be used because the copy stored on the hard
drive
keeps updating itself when the file is opened.

regards

jat




jatman

POInv macro w/ if then statement
 
i try the template format sometime this month;

regards,

jat

"Roger Govier" wrote:

Hi

You could use something like
Range("M7") = Format(date, "dd mmm yyyy")

Date in VBA will return the current date.

If you made your PO a Template, rather than a .xls file, you could save
yourself the task of

- cleans the purchase order back to original state
- saves the new blank po



--
Regards

Roger Govier


"jatman" wrote in message
...
i have a macro that runs when i press the big button (macro is in
module).
macro does the following:
- saves a copy of the purchase order based on the po number and date
stamp
- saves a copy on the hard drive
- emails a copy to accounts payable
- prints a copy for the actual invoice
- cleans the purchase order back to original state
- increases the po number by 1
- saves the new blank po

the date cell contains "[Ctrl] ;" - i want them to use that so the
date is
entered in a preformatted condition and cannot be incorrect

i used the following code at the start of the macro
If .Range("M7") < "[Ctrl] ;" Then
with End If at the end of the macro, but it does not work.

is there any other way to enter the current date into the macro so
that M7
self populates when the macro is run.

- the code =today() cannot be used because the copy stored on the hard
drive
keeps updating itself when the file is opened.

regards

jat





jatman

POInv macro w/ if then statement
 
code works, thank you

jat


"Roger Govier" wrote:

Hi

You could use something like
Range("M7") = Format(date, "dd mmm yyyy")

Date in VBA will return the current date.

If you made your PO a Template, rather than a .xls file, you could save
yourself the task of

- cleans the purchase order back to original state
- saves the new blank po



--
Regards

Roger Govier


"jatman" wrote in message
...
i have a macro that runs when i press the big button (macro is in
module).
macro does the following:
- saves a copy of the purchase order based on the po number and date
stamp
- saves a copy on the hard drive
- emails a copy to accounts payable
- prints a copy for the actual invoice
- cleans the purchase order back to original state
- increases the po number by 1
- saves the new blank po

the date cell contains "[Ctrl] ;" - i want them to use that so the
date is
entered in a preformatted condition and cannot be incorrect

i used the following code at the start of the macro
If .Range("M7") < "[Ctrl] ;" Then
with End If at the end of the macro, but it does not work.

is there any other way to enter the current date into the macro so
that M7
self populates when the macro is run.

- the code =today() cannot be used because the copy stored on the hard
drive
keeps updating itself when the file is opened.

regards

jat






All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com