Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 08-12-2011, 12:02 PM
Catalin.B Catalin.B is offline Date formatting Windows Vista Date formatting Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

check this link for instructions on how to set up your first macro...
http://office.microsoft.com/en-us/ex...138.aspx?CTT=1

repeat the operations in video, after you stop the macro, press visual basic button as picture attached, and replace your newly created macro with this macro: (your visual basic window should look like in picture attached...) Next step is to press the little green triangle highlighted in red in picture attached, it will do your job in less than 30 seconds. But attention, if you have wrong data in AD column, as i posted before, ( remember: "AD1, there is a text: "Nov-09" !! this is just a piece of text to excel, cannot recognize it as a date...There is no way excel can recognize it as 11/3/2009" )...you have to reenter data in those cells. Good luck !

Sub RecalculateCells()
Dim i As Integer
Application.ScreenUpdating = False

For i = 1 To 1000 'if you need more than 1000 rows, change here
ActiveSheet.Cells(i, 4).Select '4 means column D
Selection.NumberFormat = "mm/dd/yyyy" 'choose format for D column
ActiveCell.Value = ActiveCell.Value ' recalculate cells selected
Next i

For i = 1 To 1000 'if you need more than 1000 rows, change here
ActiveSheet.Cells(i, 30).Select '30 means column AD
Selection.NumberFormat = "mm/dd/yyyy" 'choose format for D column
ActiveCell.Value = ActiveCell.Value ' recalculate cells selected
Next i

ActiveSheet.Cells(1, 4).Activate
Application.ScreenUpdating = True
End Sub
Reply With Quote
 

Tags
formatting



Similar Threads
Thread Thread Starter Forum Replies Last Post
Date formatting Date formatting kjxavier Excel 6 08-12-2011 05:46 AM
Date formatting Date Formatting in MS word 2007 Karthick Word 4 01-19-2010 05:54 AM
Date formatting Inserting Date, formatting to superscript and subscript louq Word 1 10-22-2009 09:29 AM
new appointment date always reverts back to today's date msills Outlook 0 08-24-2007 08:57 AM
Date formatting Imported message date change to today's date promark Outlook 1 12-23-2005 07:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft