Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2023, 11:55 AM
eyefuel eyefuel is offline Link (to Excel cell) Field Date Formatting Showing Incorrect Year Windows 10 Link (to Excel cell) Field Date Formatting Showing Incorrect Year Office 2021
Novice
Link (to Excel cell) Field Date Formatting Showing Incorrect Year
 
Join Date: May 2023
Posts: 2
eyefuel is on a distinguished road
Default Link (to Excel cell) Field Date Formatting Showing Incorrect Year


Hello,

I have a word document with some link fields I am trying to format. The fields in excel are formatted with a date format of MMM-yy, but I want them to show in Word as MMMM yyyy. Here is the field code in Word:

{ LINK Excel.SheetMacroEnabled.12 "\\\\fs-01\\My Documents\\JOB FILE FOLDER\\2023\\23-060.xlsm" "LMT!R6C3" \a \t \@ "MMMM yyyy" }

The cell in Excel looks like this May-23, and the field in Word displays May 2023. This is as it should be. The problem occurs when I link another cell with a date from one year earlier.

In Excel, the date is May-22, and if I don't add the date switch, it displays May-22 in Word. When I add \@ "MMMM yyyy" to the switch, it displays May 2023.

Here is the field code:

{ LINK Excel.SheetMacroEnabled.12 "\\\\fs-01\\My Documents\\JOB FILE FOLDER\\2023\\23-060.xlsm" "LMT!R6C4" \a \t \@ "MMMM yyyy" }

Why does it show the current year?
Reply With Quote
  #2  
Old 06-15-2023, 12:25 PM
kilroyscarnival kilroyscarnival is offline Link (to Excel cell) Field Date Formatting Showing Incorrect Year Windows 10 Link (to Excel cell) Field Date Formatting Showing Incorrect Year Office 2021
Expert
 
Join Date: May 2019
Posts: 346
kilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nice
Default

There's no change the "May-22" as displayed is actually "May 22" as in the twenty-second of May, in American date style, is there? When you select that sell, the formula bar is telling you it's 5/__/2022? and not 5/22/2023?
Reply With Quote
  #3  
Old 06-15-2023, 12:32 PM
eyefuel eyefuel is offline Link (to Excel cell) Field Date Formatting Showing Incorrect Year Windows 10 Link (to Excel cell) Field Date Formatting Showing Incorrect Year Office 2021
Novice
Link (to Excel cell) Field Date Formatting Showing Incorrect Year
 
Join Date: May 2023
Posts: 2
eyefuel is on a distinguished road
Default

The cell is actually a formula - EOMOnth(D5,-1). If I apply the format M/dd/yyyy it displays 5/31/2022.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Link (to Excel cell) Field Date Formatting Showing Incorrect Year Empty date cell shows wrong month & year Learner7 Excel 3 06-16-2019 11:09 AM
changing only year component in a date field using vba Zhibek Word VBA 5 08-16-2018 01:29 AM
Baseline Slippage showing incorrect date jim44 Project 0 04-29-2018 06:05 PM
Link (to Excel cell) Field Date Formatting Showing Incorrect Year Year date not showing at bottom of chart. snowboarder2 Excel 4 02-28-2017 05:13 PM
How to calculate a rolling year-to-date percentage by quarter as the year progresses sleake Excel Programming 2 04-23-2015 11:51 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:31 AM.


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