ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help write Macro (https://www.excelbanter.com/excel-discussion-misc-queries/55703-help-write-macro.html)

nc

Help write Macro
 
Date Month


I have two columns as above Date and Month. I would like to use a macro to
write the function =MthName(MONTH(A129)) in the month column in the same row
when I populate the date field.

Roger Govier

Help write Macro
 
Hi

If it is only for display purposes, you don't need a macro
In B2 enter =A1 then format the cell as follows
FormatCellsNumberCustom mmmm

Regards

Roger Govier


nc wrote:
Date Month


I have two columns as above Date and Month. I would like to use a macro to
write the function =MthName(MONTH(A129)) in the month column in the same row
when I populate the date field.


Dave Peterson

Help write Macro
 
How about an alternative:

=text(a129,"mmmm")
or
=if(a129="","",text(a129,"mmmm"))





nc wrote:

Date Month

I have two columns as above Date and Month. I would like to use a macro to
write the function =MthName(MONTH(A129)) in the month column in the same row
when I populate the date field.


--

Dave Peterson

nc

Help write Macro
 
Dave

Thanks for your suggestion, but I only wanted the cell populated if there
was a date in the corresponding cell.



"Dave Peterson" wrote:

How about an alternative:

=text(a129,"mmmm")
or
=if(a129="","",text(a129,"mmmm"))





nc wrote:

Date Month

I have two columns as above Date and Month. I would like to use a macro to
write the function =MthName(MONTH(A129)) in the month column in the same row
when I populate the date field.


--

Dave Peterson


nc

Help write Macro
 
Roger

Thanks for your reply.



"Roger Govier" wrote:

Hi

If it is only for display purposes, you don't need a macro
In B2 enter =A1 then format the cell as follows
FormatCellsNumberCustom mmmm

Regards

Roger Govier


nc wrote:
Date Month


I have two columns as above Date and Month. I would like to use a macro to
write the function =MthName(MONTH(A129)) in the month column in the same row
when I populate the date field.



Dave Peterson

Help write Macro
 
The second suggestion doesn't limit it to just dates, but it might be sufficient
if you only type dates in A129.

nc wrote:

Dave

Thanks for your suggestion, but I only wanted the cell populated if there
was a date in the corresponding cell.

"Dave Peterson" wrote:

How about an alternative:

=text(a129,"mmmm")
or
=if(a129="","",text(a129,"mmmm"))





nc wrote:

Date Month

I have two columns as above Date and Month. I would like to use a macro to
write the function =MthName(MONTH(A129)) in the month column in the same row
when I populate the date field.


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 03:58 PM.

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