VBA in Excel 2007, NumberFormat

M

mccann_mj

Data entered into a form (in ADD_REP_DATE and ADD_PRD) are in "mm/dd/yyyy"
format, and I'm trying to put them in cells with "mmm-yy" format, but these
statements aren't doing it. I've tried moving the two format statements
before the data entry statements, to no effect.

NEC_SELECT.Offset(I, 0).Cells(1, 16) = Me.ADD_REP_DATE
NEC_SELECT.Offset(I, 0).Cells(1, 17) = Me.ADD_PRD
NEC_SELECT.Offset(I, 0).Cells(1, 16).NumberFormat = "mmm-yy"
NEC_SELECT.Offset(I, 0).Cells(1, 17).NumberFormat = "mmm-yy"

Also, I recorded a macro for formating the cells, and it came up with
{Selection.NumberFormat = "[$-409]mmm-yy;@"}. Putting this in before or after
the data entry didn't work either. Do I reformat the cells, or ID another
variable with the format? And where can I find how "[$-409]mmm-yy;@" is
broken down?
 
M

mccann_mj

I couldn't find the original thread and reply, until after I posted this. I
have the answer. Thank you all for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top