Av8tordude

Well-known Member
Joined
Oct 13, 2007
Messages
1,074
Office Version
  1. 2019
Platform
  1. Windows
I want to format the date output as "mm/dd/yy", however the code is not accomplishing what I want

Original code output display show 1/15/2019

Code:
Cells(SRow, 22) = Cells(RowNum, 3)

I tried this, but nothing happens. the output display show 1/15/2019

Code:
Cells(SRow, 22) = Format(Cells(RowNum, 3), "mm/dd/yy")

If i change the format to mmm/dd/yy, the output display show Jan/01,19.

Code:
Cells(SRow, 22) = Format(Cells(RowNum, 3), "mmm/dd/yy")

So clearly its doing something, just not want I want.

Can you help...thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi,
Try

Code:
With Cells(sRow, 22)
    .Value = Cells(RowNum, 3).Value
     .NumberFormat = "mm/dd/yy"
End With

Dave
 
Upvote 0
Excellent... Thank you for your assistance dmt32....Cheers
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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