Excel Macro - How to make whole column always Today's date

Gomes1985

New Member
Joined
Jun 20, 2016
Messages
32
Hi All,

Background - I have 2 Excel Files A and B

I manually copy all data from File A to B exact copy.

I am Reading from File B only ( dont ask why not read from A as its a process) B

After I copy the data to File I Read Line by line to a Sessions Screen to do that I need to make all cells text. Done using

Sheets("sheet1").Select
Cells.Select
Selection.NumberFormat = "@"

Issue -As soon as above code is read Column N in File B changes todays date 01072016 changes to
42552

<tbody>
</tbody>

Other dates dont change because there is no formula only this column in File B chnages because of the =TODAY() formula

Because of that Sessions Screen rejects the input.

Solution - My opinion to go around it after I run

Sheets("sheet1").Select
Cells.Select
Selection.NumberFormat = "@"

I want to ran another code

make column N always this format today 01072016

Does any one can tell how would I can make a whole column like that or any other better way?

Thank you
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Code:
Sheets("sheet1").Cells.NumberFormat = "@"
Sheets("sheet1").Columns(14).NumberFormat = "ddmmyyyy"

WBD
 
Upvote 0
change
Selection.NumberFormat = "@"
to
Selection.NumberFormat = "ddmmyyyy"
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

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