Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9110967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:23:39+00:00 2026-06-17T03:23:39+00:00

I am exporting an Excel worksheet from Microsoft Project and trying to import that

  • 0

I am exporting an Excel worksheet from Microsoft Project and trying to import that exported worksheet into an existing worksheet in Excel.

It’s working correctly, however, there are string date representations (stored as m/d/yy hh:mm AM/PM) that just won’t format correctly, even if I select Format Cells in Excel’s GUI and try to format as a date. The strings just don’t change.

What can I do? Is there code I can place in my import sub? Is there a better way to export via Project so that the dates are formatted correctly already?

Here is my current sub used for importing the worksheet (saved via Project):

Sub Import_from_Project()
    Dim wbSource As Workbook, wbDestination As Workbook
    Dim wsSource As Worksheet, wsDestination As Worksheet
    Dim DTAddress As String

    DTAddress = CreateObject("WScript.Shell").SpecialFolders("Desktop") & Application.PathSeparator

    Application.ScreenUpdating = False

    Set wbSource = Workbooks.Open(DTAddress & "Import.xlsx")
    Set wbDestination = ThisWorkbook

    Set wsSource = wbSource.Sheets(1)
    Set wsDestination = wbDestination.Sheets(6)

    'The range below is the data I'm copying
    'Only columns B and C contain the strings that I want to convert to date
    With wsSource
        .Range(.Range("A2"), .Range("C2").End(xlDown)).Copy wsDestination.Range("A3")
    End With

    'Pseudocode to loop through strings and convert to dates
    'With wsSource
    '    .Range(.Range("B2"), .Range("C2").End(xlDown)) .FORMAT TO DATE?

    wbSource.Close SaveChanges:=False
    ' wbDestination.Close SaveChanges:=True
    Application.ScreenUpdating = True

End Sub

I assume I would have to use the CDATE function, but I’m not sure how it fits in with the pseudocode above:

Format(CDate(stringDateRepresentation), "m/yyyy")

EDIT: If it’s important, I’m using Office 2010.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:23:40+00:00Added an answer on June 17, 2026 at 3:23 am
    1. Format the column as dates
    2. Then use this code to overwrite the cell. Assuming that A1 has a date which is stored as string

    Code Example

    Columns(1).NumberFormat = "m/d/yy hh:mm AM/PM"
    Range("A1").Formula = Range("A1").Value
    

    The above is an example, for a column full of values, you have to loop through the cells and perform the above operation.

    ScreenShot

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have some Spanish content saved in Excel, that I am exporting into
I am exporting a datatable to an excel sheet successfully... In that excel sheet
I am trying to build a generic method for exporting a list to excel.
Iam exporting a DataTable to an Excel-file using office interop. The problem is, that
I am exporting an excel workbook into xml spreadsheet. The excel has lets say
I've an SSIS package that runs a stored proc for exporting to an excel
I am exporting from a database to excel. While doing so it is exporting
I'm Exporting from SSRS to Excel using SimplePageHeaders=True. (This is because there is a
I'm exporting an Excel.Worksheet in C# like this: myWorksheet.SaveAs(myPath, Excel.XlFileFormat.xlCSV); it works almost ok,
I am exporting my data into Excel Using Open XML . now i want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.